rm openssl3 package
This commit is contained in:
@@ -1,73 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
VERSION="openssl-3.4.1"
|
|
||||||
INSTALL_DIR="$DIR/openssl3/install"
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
|
||||||
export CC="ccache ${CC:-cc}"
|
|
||||||
|
|
||||||
# Clone/update source
|
|
||||||
if [ ! -d "openssl-src/.git" ]; then
|
|
||||||
rm -rf openssl-src
|
|
||||||
git clone --depth 1 https://github.com/openssl/openssl.git openssl-src
|
|
||||||
fi
|
|
||||||
git -C openssl-src fetch --depth 1 origin "$VERSION"
|
|
||||||
WANT_COMMIT="$(git -C openssl-src rev-parse FETCH_HEAD)"
|
|
||||||
VERSION_FILE="$INSTALL_DIR/.version"
|
|
||||||
if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$WANT_COMMIT" ]; then
|
|
||||||
echo "openssl already at $VERSION, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
git -C openssl-src checkout --force FETCH_HEAD
|
|
||||||
|
|
||||||
# Configure
|
|
||||||
PREFIX="$DIR/build/prefix"
|
|
||||||
cd openssl-src
|
|
||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
|
||||||
TARGET="darwin64-arm64-cc"
|
|
||||||
else
|
|
||||||
MACHINE="$(uname -m)"
|
|
||||||
if [ "$MACHINE" = "x86_64" ]; then
|
|
||||||
TARGET="linux-x86_64"
|
|
||||||
elif [ "$MACHINE" = "aarch64" ]; then
|
|
||||||
TARGET="linux-aarch64"
|
|
||||||
else
|
|
||||||
TARGET="linux-${MACHINE}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
./Configure "$TARGET" \
|
|
||||||
--prefix="$PREFIX" \
|
|
||||||
--libdir=lib \
|
|
||||||
no-shared \
|
|
||||||
no-tests \
|
|
||||||
no-docs \
|
|
||||||
no-apps \
|
|
||||||
-fPIC \
|
|
||||||
-Os
|
|
||||||
|
|
||||||
# Build
|
|
||||||
make -j"$NJOBS"
|
|
||||||
make install_sw
|
|
||||||
|
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
# Copy to package install dir
|
|
||||||
rm -rf "$INSTALL_DIR"
|
|
||||||
mkdir -p "$INSTALL_DIR"/{lib,include}
|
|
||||||
|
|
||||||
# Libraries
|
|
||||||
cp "$PREFIX/lib/libcrypto.a" "$INSTALL_DIR/lib/"
|
|
||||||
cp "$PREFIX/lib/libssl.a" "$INSTALL_DIR/lib/"
|
|
||||||
|
|
||||||
# Headers
|
|
||||||
cp -r "$PREFIX/include/openssl" "$INSTALL_DIR/include/"
|
|
||||||
|
|
||||||
echo "$WANT_COMMIT" > "$VERSION_FILE"
|
|
||||||
echo "Installed openssl to $INSTALL_DIR"
|
|
||||||
du -sh "$INSTALL_DIR"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
DIR = os.path.join(os.path.dirname(__file__), "install")
|
|
||||||
LIB_DIR = os.path.join(DIR, "lib")
|
|
||||||
INCLUDE_DIR = os.path.join(DIR, "include")
|
|
||||||
|
|
||||||
|
|
||||||
def smoketest():
|
|
||||||
assert os.path.isfile(os.path.join(LIB_DIR, "libcrypto.a")), "libcrypto.a not found"
|
|
||||||
assert os.path.isfile(os.path.join(LIB_DIR, "libssl.a")), "libssl.a not found"
|
|
||||||
assert os.path.isdir(os.path.join(INCLUDE_DIR, "openssl")), "openssl headers not found"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[build-system]
|
|
||||||
requires = ["setuptools>=64", "wheel"]
|
|
||||||
build-backend = "setuptools.build_meta"
|
|
||||||
|
|
||||||
[project]
|
|
||||||
name = "openssl3"
|
|
||||||
version = "3.4.1"
|
|
||||||
description = "OpenSSL cryptography library (static build)"
|
|
||||||
requires-python = ">=3.8"
|
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
|
||||||
include = ["openssl3*"]
|
|
||||||
|
|
||||||
[tool.setuptools.package-data]
|
|
||||||
openssl3 = ["install/**/*"]
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import os
|
|
||||||
import platform
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
from setuptools.command.build_py import build_py
|
|
||||||
|
|
||||||
try:
|
|
||||||
from wheel.bdist_wheel import bdist_wheel
|
|
||||||
except ImportError:
|
|
||||||
bdist_wheel = None
|
|
||||||
|
|
||||||
|
|
||||||
class BuildOpenssl(build_py):
|
|
||||||
"""Run build.sh to compile OpenSSL before collecting package data."""
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
|
||||||
|
|
||||||
|
|
||||||
cmdclass = {"build_py": BuildOpenssl}
|
|
||||||
|
|
||||||
if bdist_wheel is not None:
|
|
||||||
|
|
||||||
class PlatformWheel(bdist_wheel):
|
|
||||||
"""Produce a platform-specific, Python-version-agnostic wheel."""
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
super().finalize_options()
|
|
||||||
self.root_is_pure = False
|
|
||||||
|
|
||||||
def get_tag(self):
|
|
||||||
system = platform.system()
|
|
||||||
machine = platform.machine()
|
|
||||||
|
|
||||||
if system == "Linux":
|
|
||||||
plat = f"linux_{machine}"
|
|
||||||
elif system == "Darwin":
|
|
||||||
plat = "macosx_11_0_arm64"
|
|
||||||
else:
|
|
||||||
plat = f"{system.lower()}_{machine}"
|
|
||||||
|
|
||||||
return "py3", "none", plat
|
|
||||||
|
|
||||||
cmdclass["bdist_wheel"] = PlatformWheel
|
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
|
||||||
from setuptools import setup as _setup
|
|
||||||
|
|
||||||
_setup(cmdclass=cmdclass)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
setup()
|
|
||||||
@@ -12,7 +12,6 @@ members = [
|
|||||||
"libjpeg",
|
"libjpeg",
|
||||||
"libyuv",
|
"libyuv",
|
||||||
"ncurses",
|
"ncurses",
|
||||||
"openssl3",
|
|
||||||
"python3-dev",
|
"python3-dev",
|
||||||
"raylib",
|
"raylib",
|
||||||
"zeromq",
|
"zeromq",
|
||||||
|
|||||||
Reference in New Issue
Block a user