From 9d7d180d51f2772561c5f03b83bab23111da20f1 Mon Sep 17 00:00:00 2001 From: ASUS1 Date: Mon, 16 Aug 2021 11:57:18 -0700 Subject: [PATCH 1/4] initial commit Exiv2 build_tarballs.jl --- E/Exiv2/build_tarballs.jl | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 E/Exiv2/build_tarballs.jl diff --git a/E/Exiv2/build_tarballs.jl b/E/Exiv2/build_tarballs.jl new file mode 100644 index 00000000000..314137e5abc --- /dev/null +++ b/E/Exiv2/build_tarballs.jl @@ -0,0 +1,58 @@ +# Note that this script can accept some limited command-line arguments, run +# `julia build_tarballs.jl --help` to see a usage message. +using BinaryBuilder, Pkg + +name = "Exiv2" +version = v"0.27.4" + +# Collection of sources required to complete build +sources = [ + ArchiveSource("https://github.com/Exiv2/exiv2/archive/refs/tags/v$(version).tar.gz", "9fb2752c92f63c9853e0bef9768f21138eeac046280f40ded5f37d06a34880d9") +] + +# Bash recipe for building across all platforms +script = raw""" + +cd $WORKSPACE/srcdir/exiv2-* + +if [[ "${target}" == *-linux-musl ]]; then + # Delete libexpat to prevent it from being picked up by mistake + rm /usr/lib/libexpat.so* +fi + +mkdir build +cd build/ + +cmake .. \ +-DCMAKE_INSTALL_PREFIX=$prefix \ +-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ +-DCMAKE_BUILD_TYPE=Release \ +-DEXIV2_BUILD_SAMPLES=OFF \ +-DIconv_INCLUDE_DIR=${includedir} + +make -j${nproc} +make install +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = expand_cxxstring_abis(supported_platforms(; experimental=true)) + + +# The products that we will ensure are always built +products = [ + LibraryProduct("libexiv2", :libexiv2), + ExecutableProduct("exiv2", :exiv2) +] + +# Dependencies that must be installed before this package can be built +dependencies = [ + Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a")) + Dependency(PackageSpec(name="Expat_jll", uuid="2e619515-83b5-522b-bb60-26c02a35a201")) + Dependency(PackageSpec(name="libpng_jll", uuid="b53b4c65-9356-5827-b1ea-8c7a1a84506f")) + Dependency(PackageSpec(name="Gettext_jll", uuid="78b55507-aeef-58d4-861c-77aaff3498b1")) + Dependency(PackageSpec(name="Libiconv_jll", uuid="94ce4f54-9a6c-5748-9c1c-f9c7231a4531")) +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6") \ No newline at end of file From a1ba3974bf3b0a7c9d0b7bcb1775285acd5bdf0e Mon Sep 17 00:00:00 2001 From: ASUS1 Date: Mon, 16 Aug 2021 12:24:55 -0700 Subject: [PATCH 2/4] remove gettext, add newline at eof, make musl expat delete more specific --- E/Exiv2/build_tarballs.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/E/Exiv2/build_tarballs.jl b/E/Exiv2/build_tarballs.jl index 314137e5abc..4e5d1e792a0 100644 --- a/E/Exiv2/build_tarballs.jl +++ b/E/Exiv2/build_tarballs.jl @@ -15,7 +15,7 @@ script = raw""" cd $WORKSPACE/srcdir/exiv2-* -if [[ "${target}" == *-linux-musl ]]; then +if [[ "${target}" == x86_64-linux-musl ]]; then # Delete libexpat to prevent it from being picked up by mistake rm /usr/lib/libexpat.so* fi @@ -50,9 +50,8 @@ dependencies = [ Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a")) Dependency(PackageSpec(name="Expat_jll", uuid="2e619515-83b5-522b-bb60-26c02a35a201")) Dependency(PackageSpec(name="libpng_jll", uuid="b53b4c65-9356-5827-b1ea-8c7a1a84506f")) - Dependency(PackageSpec(name="Gettext_jll", uuid="78b55507-aeef-58d4-861c-77aaff3498b1")) Dependency(PackageSpec(name="Libiconv_jll", uuid="94ce4f54-9a6c-5748-9c1c-f9c7231a4531")) ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6") \ No newline at end of file +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6") From af0086835d8d5c84e47085222ad2d76a0801fa20 Mon Sep 17 00:00:00 2001 From: ASUS1 Date: Mon, 16 Aug 2021 19:18:12 -0700 Subject: [PATCH 3/4] add patch for i686-linux-musl to get around strong stack protection issues --- E/Exiv2/build_tarballs.jl | 11 ++++++++++- ...86-musl-comment-stack-protector-strong.patch | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 E/Exiv2/bundled/patches/i686-musl-comment-stack-protector-strong.patch diff --git a/E/Exiv2/build_tarballs.jl b/E/Exiv2/build_tarballs.jl index 4e5d1e792a0..d2b0f9eead3 100644 --- a/E/Exiv2/build_tarballs.jl +++ b/E/Exiv2/build_tarballs.jl @@ -7,7 +7,8 @@ version = v"0.27.4" # Collection of sources required to complete build sources = [ - ArchiveSource("https://github.com/Exiv2/exiv2/archive/refs/tags/v$(version).tar.gz", "9fb2752c92f63c9853e0bef9768f21138eeac046280f40ded5f37d06a34880d9") + ArchiveSource("https://github.com/Exiv2/exiv2/archive/refs/tags/v$(version).tar.gz", "9fb2752c92f63c9853e0bef9768f21138eeac046280f40ded5f37d06a34880d9"), + DirectorySource("./bundled") ] # Bash recipe for building across all platforms @@ -18,6 +19,14 @@ cd $WORKSPACE/srcdir/exiv2-* if [[ "${target}" == x86_64-linux-musl ]]; then # Delete libexpat to prevent it from being picked up by mistake rm /usr/lib/libexpat.so* + +elif [[ "${target}" == i686-linux-musl ]]; then + + #otherwise, patch fails with different line endings message + dos2unix cmake/compilerFlags.cmake + + atomic_patch -p1 ${WORKSPACE}/srcdir/patches/i686-musl-comment-stack-protector-strong.patch + fi mkdir build diff --git a/E/Exiv2/bundled/patches/i686-musl-comment-stack-protector-strong.patch b/E/Exiv2/bundled/patches/i686-musl-comment-stack-protector-strong.patch new file mode 100644 index 00000000000..526215e94d7 --- /dev/null +++ b/E/Exiv2/bundled/patches/i686-musl-comment-stack-protector-strong.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake +index 35faf50..5421607 100644 +--- a/cmake/compilerFlags.cmake ++++ b/cmake/compilerFlags.cmake +@@ -34,9 +34,9 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN + if(HAS_FCF_PROTECTION) + add_compile_options(-fcf-protection) + endif() +- if(HAS_FSTACK_PROTECTOR_STRONG) +- add_compile_options(-fstack-protector-strong) +- endif() ++ # if(HAS_FSTACK_PROTECTOR_STRONG) ++ # add_compile_options(-fstack-protector-strong) ++ # endif() + endif() + + add_compile_options(-Wp,-D_GLIBCXX_ASSERTIONS) From 4d2995c8896fd6ba15f8ebd08932fb5953e736a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 18 Aug 2021 00:00:47 +0100 Subject: [PATCH 4/4] Update E/Exiv2/build_tarballs.jl --- E/Exiv2/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/E/Exiv2/build_tarballs.jl b/E/Exiv2/build_tarballs.jl index d2b0f9eead3..1def70a9493 100644 --- a/E/Exiv2/build_tarballs.jl +++ b/E/Exiv2/build_tarballs.jl @@ -57,7 +57,7 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ Dependency(PackageSpec(name="Zlib_jll", uuid="83775a58-1f1d-513f-b197-d71354ab007a")) - Dependency(PackageSpec(name="Expat_jll", uuid="2e619515-83b5-522b-bb60-26c02a35a201")) + Dependency("Expat_jll"; compat="2.2.10") Dependency(PackageSpec(name="libpng_jll", uuid="b53b4c65-9356-5827-b1ea-8c7a1a84506f")) Dependency(PackageSpec(name="Libiconv_jll", uuid="94ce4f54-9a6c-5748-9c1c-f9c7231a4531")) ]