Skip to content

Commit

Permalink
Avoid all GPL dependencies to prevent licensing issues!
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxwell175 committed Jan 21, 2024
1 parent e2539a2 commit ce549e2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 83 deletions.
6 changes: 3 additions & 3 deletions Modules/Setup
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,15 @@ _crypt _cryptmodule.c -l:libcrypt.a
_bz2 _bz2module.c -l:libbz2.a
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -ldl -l:libffi.a -DHAVE_FFI_PREP_CIF_VAR -DHAVE_FFI_PREP_CLOSURE_LOC -DHAVE_FFI_CLOSURE_ALLOC
# The _dbm module supports NDBM, GDBM with compat module, and Berkeley DB.
_dbm _dbmmodule.c -l:libgdbm_compat.a -DUSE_GDBM_COMPAT
_gdbm _gdbmmodule.c -l:libgdbm.a
#_dbm _dbmmodule.c -l:libgdbm_compat.a -DUSE_GDBM_COMPAT
#_gdbm _gdbmmodule.c -l:libgdbm.a
_lzma _lzmamodule.c -l:liblzma.a
_uuid _uuidmodule.c -l:libuuid.a
zlib zlibmodule.c -l:libz.a

# The readline module also supports libeditline (-leditline).
# Some systems may require -ltermcap or -ltermlib.
readline readline.c -l:libreadline.a
#readline readline.c -l:libeditline.a -DWITH_EDITLINE

# OpenSSL bindings
#_ssl _ssl.c $(OPENSSL_INCLUDES) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS)
Expand Down
135 changes: 56 additions & 79 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ export "PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig"
mkdir -p dep-build
cd dep-build

if [ ! -d readline-8.2 ]; then
curl https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz -o readline.tar.gz
tar -xf readline.tar.gz
cd readline-8.2
./configure --prefix=${PREFIX} --disable-shared
make -j$(nproc --all)
make install
cd ..
fi

if [ ! -d ncurses-6.4 ]; then
curl https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz -o ncurses.tar.gz
tar -xf ncurses.tar.gz
Expand All @@ -55,6 +45,16 @@ make install
cd ..
fi

if [ ! -d editline-1.17.1 ]; then
curl -L https://github.com/troglobit/editline/releases/download/1.17.1/editline-1.17.1.tar.gz -o editline.tar.gz
tar -xf editline.tar.gz
cd editline-1.17.1
./configure --prefix=${PREFIX} --disable-shared
make -j$(nproc --all)
make install
cd ..
fi

if [ ! -d sqlite-autoconf-3440000 ]; then
curl https://sqlite.org/2023/sqlite-autoconf-3440000.tar.gz -o sqlite.tar.gz
tar -xf sqlite.tar.gz
Expand All @@ -75,18 +75,6 @@ make install
cd ..
fi

if [ ! -d gdbm-1.23 ]; then
curl https://ftp.gnu.org/gnu/gdbm/gdbm-1.23.tar.gz -o gdbm.tar.gz
tar -xf gdbm.tar.gz
cd gdbm-1.23
./configure --prefix=${PREFIX} --disable-shared --enable-libgdbm-compat
make -j$(nproc --all)
make install
mkdir -p ${PREFIX}/include/gdbm
cp ./compat/dbm.h ./compat/ndbm.h ${PREFIX}/include/gdbm
cd ..
fi

if [ ! -d bzip2-1.0.8 ]; then
curl https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz -o bzip2.tar.gz
tar -xf bzip2.tar.gz
Expand Down Expand Up @@ -137,26 +125,6 @@ make install
cd ..
fi

if [ ! -d libiconv-1.17 ]; then
curl https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz -o iconv.tar.gz
tar -xf iconv.tar.gz
cd libiconv-1.17
./configure --prefix=${PREFIX} --disable-shared
make -j$(nproc --all)
make install
cd ..
fi

if [ ! -d gettext-0.22.3 ]; then
curl https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.3.tar.gz -o gettext.tar.gz
tar -xf gettext.tar.gz
cd gettext-0.22.3
./configure --prefix=${PREFIX} --disable-shared
make -j$(nproc --all)
make install
cd ..
fi

if [ ! -d libxcrypt-4.4.36 ]; then
curl -L https://github.com/besser82/libxcrypt/releases/download/v4.4.36/libxcrypt-4.4.36.tar.xz -o libxcrypt.tar.xz
tar -xf libxcrypt.tar.xz
Expand All @@ -167,15 +135,6 @@ make install
cd ..
fi

if [ ! -d bzip2-bzip2-1.0.8 ]; then
curl https://gitlab.com/bzip2/bzip2/-/archive/bzip2-1.0.8/bzip2-bzip2-1.0.8.tar.gz -o bzip2.tar.gz
tar -xf bzip2.tar.gz
cd bzip2-bzip2-1.0.8
make -j$(nproc --all)
make install PREFIX=${PREFIX}
cd ..
fi

if [ ! -d libffi-3.4.4 ]; then
curl -L https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz -o libffi.tar.gz
tar -xf libffi.tar.gz
Expand Down Expand Up @@ -206,24 +165,14 @@ make install
cd ..
fi

if [ ! -d tcl8.6.13 ]; then
curl -L http://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tcl8.6.13-src.tar.gz -o tcl.tar.gz
tar -xf tcl.tar.gz
cd tcl8.6.13/unix
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads
make -j$(nproc --all)
make install
cd ../..
fi

if [ ! -d tk8.6.13 ]; then
curl -L http://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tk8.6.13-src.tar.gz -o tk.tar.gz
tar -xf tk.tar.gz
cd tk8.6.13/unix
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads --with-tcl=${PREFIX}/lib
if [ ! -d editline-1.17.1 ]; then
curl -L https://github.com/troglobit/editline/releases/download/1.17.1/editline-1.17.1.tar.gz -o editline.tar.gz
tar -xf editline.tar.gz
cd editline-1.17.1
./configure --prefix=${PREFIX} --disable-shared
make -j$(nproc --all)
make install
cd ../..
cd ..
fi

if [ ! -d xtrans-1.5.0 ]; then
Expand Down Expand Up @@ -256,6 +205,16 @@ make install
cd ..
fi

if [ ! -d freetype-2.13.2 ]; then
curl -L https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.gz -o freetype.tar.gz
tar -xf freetype.tar.gz
cd freetype-2.13.2
./configure --prefix=${PREFIX} --disable-shared --with-brotli=no
make -j$(nproc --all)
make install
cd ..
fi

if [ ! -d libXft-2.3.8 ]; then
curl -L https://xorg.freedesktop.org/releases/individual/lib/libXft-2.3.8.tar.gz -o libXft.tar.gz
tar -xf libXft.tar.gz
Expand Down Expand Up @@ -336,14 +295,24 @@ make install
cd ..
fi

if [ ! -d freetype-2.13.2 ]; then
curl -L https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.gz -o freetype.tar.gz
tar -xf freetype.tar.gz
cd freetype-2.13.2
./configure --prefix=${PREFIX} --disable-shared --with-brotli=no
if [ ! -d tcl8.6.13 ]; then
curl -L http://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tcl8.6.13-src.tar.gz -o tcl.tar.gz
tar -xf tcl.tar.gz
cd tcl8.6.13/unix
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads
make -j$(nproc --all)
make install
cd ..
cd ../..
fi

if [ ! -d tk8.6.13 ]; then
curl -L http://downloads.sourceforge.net/project/tcl/Tcl/8.6.13/tk8.6.13-src.tar.gz -o tk.tar.gz
tar -xf tk.tar.gz
cd tk8.6.13/unix
./configure --prefix=${PREFIX} --enable-shared=no --enable-threads --with-tcl=${PREFIX}/lib
make -j$(nproc --all) "X11_LIB_SWITCHES=-l:libX11.a -l:libxcb.a -l:libXss.a -l:libfontconfig.a -l:libXft.a -l:libXext.a -l:libXrandr.a -l:libXau.a -l:libXrender.a -l:libXdmcp.a -l:libfreetype.a -l:libexpat.a -l:libpng.a -l:libharfbuzz.a -l:libX11.a -l:libxcb.a -l:libbz2.a"
make install
cd ../..
fi

if [ ! -d expat-2.5.0 ]; then
Expand All @@ -356,6 +325,16 @@ make install
cd ..
fi

if [ ! -d mpdecimal-4.0.0 ]; then
curl -L https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.0.tar.gz -o mpdecimal.tar.gz
tar -xf mpdecimal.tar.gz
cd mpdecimal-4.0.0
./configure --prefix=${PREFIX} --disable-shared
make -j$(nproc --all)
make install
cd ..
fi

if [ ! -d libb2-0.98.1 ]; then
curl -L https://github.com/BLAKE2/libb2/releases/download/v0.98.1/libb2-0.98.1.tar.gz -o libb2.tar.gz
tar -xf libb2.tar.gz
Expand Down Expand Up @@ -400,7 +379,8 @@ fi

# The UCS4 has best compatibility with wheels on PyPI it seems.
./configure "--prefix=$target" --disable-shared --enable-ipv6 --enable-unicode=ucs4 \
--enable-optimizations --with-lto --with-computed-gotos --with-fpectl \
--enable-optimizations --with-lto --with-computed-gotos --with-fpectl --without-readline \
--with-system-expat --with-system-libmpdec
CC="$CC" \
CXX="$CXX" \
CFLAGS="-g $CFLAGS" \
Expand Down Expand Up @@ -428,22 +408,19 @@ $ELEVATE mv "$target/lib/python${long_version}/pip.py" "$target/lib/python${long
$ELEVATE mkdir -p "$target/dependency_libs"
$ELEVATE cp -r "$(pwd)/../Nuitka-Python-Deps" "$target/dependency_libs/base"
$ELEVATE ln -s base "$target/dependency_libs/bzip2"
$ELEVATE ln -s base "$target/dependency_libs/editline"
$ELEVATE ln -s base "$target/dependency_libs/expat"
$ELEVATE ln -s base "$target/dependency_libs/fontconfig"
$ELEVATE ln -s base "$target/dependency_libs/freetype"
$ELEVATE ln -s base "$target/dependency_libs/gdbm"
$ELEVATE ln -s base "$target/dependency_libs/gettext"
$ELEVATE ln -s base "$target/dependency_libs/harfbuzz"
$ELEVATE ln -s base "$target/dependency_libs/b2"
$ELEVATE ln -s base "$target/dependency_libs/ffi"
$ELEVATE ln -s base "$target/dependency_libs/iconv"
$ELEVATE ln -s base "$target/dependency_libs/mpdecimal"
$ELEVATE ln -s base "$target/dependency_libs/png"
$ELEVATE ln -s base "$target/dependency_libs/X11"
$ELEVATE ln -s base "$target/dependency_libs/xcb"
$ELEVATE ln -s base "$target/dependency_libs/xcrypt"
$ELEVATE ln -s base "$target/dependency_libs/ncurses"
$ELEVATE ln -s base "$target/dependency_libs/openssl"
$ELEVATE ln -s base "$target/dependency_libs/readline"
$ELEVATE ln -s base "$target/dependency_libs/sqlite"
$ELEVATE ln -s base "$target/dependency_libs/tcltk"
$ELEVATE ln -s base "$target/dependency_libs/uuid"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ def detect_modules(self):
self.detect_crypt()
self.detect_openssl_hashlib()
self.detect_hash_builtins()
self.detect_dbm_gdbm()
#self.detect_dbm_gdbm()
self.detect_sqlite()
self.detect_platform_specific_exts()
self.detect_nis()
Expand Down

0 comments on commit ce549e2

Please sign in to comment.