feat: sailfishos port (initial)

This commit is contained in:
Czarek Nakamoto
2024-02-28 07:34:26 +01:00
parent 4cc54124d0
commit 06c7a260e0
4 changed files with 63 additions and 13 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
NPROC=1 NPROC=12
# Boost # Boost
BOOST_VERSION=1_84_0 BOOST_VERSION=1_84_0
BOOST_VERSION_DOT=1.84.0 BOOST_VERSION_DOT=1.84.0
@@ -32,3 +32,10 @@ UTF8PROC_HASH=1cb28a66ca79a0845e99433fd1056257456cef8b
MONERO_GIT_SOURCE_SIMPLE=git.mrcyjanek.net_mrcyjanek_monero MONERO_GIT_SOURCE_SIMPLE=git.mrcyjanek.net_mrcyjanek_monero
MONERO_GIT_SOURCE=https://git.mrcyjanek.net/mrcyjanek/monero.git MONERO_GIT_SOURCE=https://git.mrcyjanek.net/mrcyjanek/monero.git
MONERO_TAG=release-v0.18.3.1-anonero MONERO_TAG=release-v0.18.3.1-anonero
# Tools
PERL_VERSION_FULL=5.38.2
PERL_VERSION_MAJOR=5.0
PERL_HASH=a0a31534451eb7b83c7d6594a497543a54d488bc90ca00f5e34762577f40655e
# System env
CC=clang
CXX=clang++
+2
View File
@@ -10,4 +10,6 @@ unbound*
utf8proc* utf8proc*
zlib* zlib*
perl-*
prefix prefix
+51 -10
View File
@@ -3,6 +3,21 @@ export $(shell sed 's/=.*//' .env)
PREFIX := ${PWD}/prefix PREFIX := ${PWD}/prefix
.PHONY: clean_download
clean_download:
rm -rf boost_*
rm -rf libexpat
rm -rf libiconv*
rm -rf libsodium
rm -rf libzmq
rm -rf monero
rm -rf openssl-*
rm -rf perl
rm -rf polyseed
rm -rf unbound
rm -rf utf8proc
rm -rf zlib
.PHONY: download .PHONY: download
download: download:
rm -rf monero rm -rf monero
@@ -24,7 +39,7 @@ download:
tar -xzf zlib-${ZLIB_VERSION}.tar.gz tar -xzf zlib-${ZLIB_VERSION}.tar.gz
rm zlib-${ZLIB_VERSION}.tar.gz rm zlib-${ZLIB_VERSION}.tar.gz
mv zlib-${ZLIB_VERSION} zlib mv zlib-${ZLIB_VERSION} zlib
openssl # openssl
curl -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz curl -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c
tar -xzf openssl-${OPENSSL_VERSION}.tar.gz tar -xzf openssl-${OPENSSL_VERSION}.tar.gz
@@ -50,12 +65,17 @@ download:
.PHONY: host_depends .PHONY: host_depends
host_depends: libiconv_host boost_host zlib_host openssl_host libzmq_host libsodium_host libexpat_host host_copy_libs unbound_host polyseed_host utf8proc_host host_depends: libiconv_host boost_host zlib_host openssl_host openssl_host_alt libzmq_host libsodium_host host_copy_libs libexpat_host unbound_host polyseed_host utf8proc_host
.PHONY: host_copy_libs .PHONY: host_copy_libs
host_copy_libs: host_copy_libs:
-cp -a ${PREFIX}/lib64/* ${PREFIX}/lib # fix linking issue (openssl?) -cp -a ${PREFIX}/lib64/* ${PREFIX}/lib # fix linking issue (openssl?)
.PHONY: host_move_libs
host_move_libs:
-cp -a ${PREFIX}/lib64/* ${PREFIX}/lib # fix linking issue (openssl?)
-rm -rf ${PREFIX}/lib64/*
.PHONY: libiconv_host .PHONY: libiconv_host
libiconv_host: libiconv_host:
cd libiconv-${ICONV_VERSION} && ./configure --prefix=${PREFIX} --disable-rpath cd libiconv-${ICONV_VERSION} && ./configure --prefix=${PREFIX} --disable-rpath
@@ -64,9 +84,12 @@ libiconv_host:
.PHONY: boost_host .PHONY: boost_host
boost_host: boost_host:
cd boost_${BOOST_VERSION} && ./bootstrap.sh --prefix=${PREFIX} cd boost_${BOOST_VERSION} && echo '' | cat - ./boost/thread/pthread/thread_data.hpp > temp && mv temp ./boost/thread/pthread/thread_data.hpp
cd boost_${BOOST_VERSION} && echo '\n#undef PTHREAD_STACK_MIN\n#define PTHREAD_STACK_MIN 16384\n' | cat - ./boost/thread/pthread/thread_data.hpp > temp && mv temp ./boost/thread/pthread/thread_data.hpp cd boost_${BOOST_VERSION} && echo '#define PTHREAD_STACK_MIN 16384' | cat - ./boost/thread/pthread/thread_data.hpp > temp && mv temp ./boost/thread/pthread/thread_data.hpp
cd boost_${BOOST_VERSION} && ./b2 cxxflags=-fPIC cflags=-fPIC --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=linux --stagedir=linux toolset=gcc threading=multi threadapi=pthread -sICONV_PATH=${PREFIX} install -j${NPROC} cd boost_${BOOST_VERSION} && echo '#undef PTHREAD_STACK_MIN'| cat - ./boost/thread/pthread/thread_data.hpp > temp && mv temp ./boost/thread/pthread/thread_data.hpp
cd boost_${BOOST_VERSION} && echo '' | cat - ./boost/thread/pthread/thread_data.hpp > temp && mv temp ./boost/thread/pthread/thread_data.hpp
cd boost_${BOOST_VERSION} && ./bootstrap.sh --prefix=${PREFIX} --with-toolset=${CC}
cd boost_${BOOST_VERSION} && ./b2 cxxflags=-fPIC cflags=-fPIC --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=linux --stagedir=linux toolset=${CC} threading=multi threadapi=pthread -sICONV_PATH=${PREFIX} install -j${NPROC}
.PHONY: zlib_host .PHONY: zlib_host
zlib_host: zlib_host:
@@ -75,7 +98,13 @@ zlib_host:
.PHONY: openssl_host .PHONY: openssl_host
openssl_host: openssl_host:
cd openssl-${OPENSSL_VERSION} && ./Configure -static no-shared no-tests --with-zlib-include=${PREFIX}/zlib/include --with-zlib-lib=${PREFIX}/zlib/lib --prefix=${PREFIX} --openssldir=${PREFIX} -fPIC cd openssl-${OPENSSL_VERSION} && env PATH="/usr/local/bin/:${PATH}" ./Configure -static no-shared no-tests --with-zlib-include=${PREFIX}/zlib/include --with-zlib-lib=${PREFIX}/zlib/lib --prefix=${PREFIX} --openssldir=${PREFIX} -fPIC
cd openssl-${OPENSSL_VERSION} && make -j${NPROC}
cd openssl-${OPENSSL_VERSION} && make install_sw
.PHONY: openssl_host_alt
openssl_host_alt:
cd openssl-${OPENSSL_VERSION} && env PATH="/usr/local/bin/:${PATH}" ./Configure -static no-shared no-tests --with-zlib-include=${PREFIX}/zlib/include --with-zlib-lib=${PREFIX}/zlib/lib --prefix=${PREFIX}/openssl --openssldir=${PREFIX}/openssl -fPIC
cd openssl-${OPENSSL_VERSION} && make -j${NPROC} cd openssl-${OPENSSL_VERSION} && make -j${NPROC}
cd openssl-${OPENSSL_VERSION} && make install_sw cd openssl-${OPENSSL_VERSION} && make install_sw
@@ -97,14 +126,14 @@ libsodium_host:
.PHONY: libexpat_host .PHONY: libexpat_host
libexpat_host: libexpat_host:
cd libexpat/expat && ./buildconf.sh cd libexpat/expat && CC=${CC} CXX=${CXX} LDFLAGS="-L${PREFIX}/lib64/" ./buildconf.sh
cd libexpat/expat && ./configure --prefix=${PREFIX} --enable-static --disable-shared cd libexpat/expat && CC=${CC} CXX=${CXX} LDFLAGS="-L${PREFIX}/lib64/" ./configure --prefix=${PREFIX} --enable-static --disable-shared
cd libexpat/expat && make -j${NPROC} cd libexpat/expat && make -j${NPROC}
cd libexpat/expat && make install cd libexpat/expat && make install
.PHONY: unbound_host .PHONY: unbound_host
unbound_host: unbound_host:
cd unbound && ./configure -with-pic --prefix=${PREFIX} --enable-static --disable-shared --disable-flto --with-libexpat=${PREFIX} --with-ssl=${PREFIX} cd unbound && CC=${CC} CXX=${CXX} LDFLAGS="-L${PREFIX}/lib64/" ./configure -with-pic --prefix=${PREFIX} --enable-static --disable-shared --disable-flto --with-libexpat=${PREFIX} --with-ssl=${PREFIX}/openssl
cd unbound && make -j${NPROC} cd unbound && make -j${NPROC}
cd unbound && make install cd unbound && make install
@@ -147,5 +176,17 @@ monero_linux_arm64:
moneroc_linux_host64: moneroc_linux_host64:
rm -rf libbridge/build || true rm -rf libbridge/build || true
mkdir -p libbridge/build mkdir -p libbridge/build
cd libbridge/build && env CC=gcc CXX=g++ cmake -DANDROID_ABI=linux-x86_64 .. cd libbridge/build && env CC=${CC} CXX=${CXX} cmake -DANDROID_ABI=linux-x86_64 ..
cd libbridge/build && make -j${NPROC} cd libbridge/build && make -j${NPROC}
# Fixed
.PHONY: host_tool_perl
host_tool_perl:
rm -rf perl-5.38.2* || true
curl -O https://www.cpan.org/src/${PERL_VERSION_MAJOR}/perl-${PERL_VERSION_FULL}.tar.gz
echo "${PERL_HASH} perl-${PERL_VERSION_FULL}.tar.gz" | sha256sum -c
tar xzf perl-5.38.2.tar.gz
./configure.gnu
make -j${NPROC}
+2 -2
View File
@@ -25,11 +25,11 @@ set_target_properties(sodium PROPERTIES IMPORTED_LOCATION
add_library(crypto STATIC IMPORTED) add_library(crypto STATIC IMPORTED)
set_target_properties(crypto PROPERTIES IMPORTED_LOCATION set_target_properties(crypto PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/prefix/lib/libcrypto.a) ${EXTERNAL_LIBS_DIR}/prefix/openssl/lib/libcrypto.a)
add_library(ssl STATIC IMPORTED) add_library(ssl STATIC IMPORTED)
set_target_properties(ssl PROPERTIES IMPORTED_LOCATION set_target_properties(ssl PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/prefix/lib/libssl.a) ${EXTERNAL_LIBS_DIR}/prefix/openssl/lib/libssl.a)
############ ############
# Boost # Boost