From 02b7a6a022dd8cfeefb5a496a8f924cff84f47b2 Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Wed, 10 Mar 2021 20:18:50 +0100 Subject: [PATCH 1/3] Add pandoc-crossref --- P/pandoc_crossref/build_tarballs.jl | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 P/pandoc_crossref/build_tarballs.jl diff --git a/P/pandoc_crossref/build_tarballs.jl b/P/pandoc_crossref/build_tarballs.jl new file mode 100644 index 00000000000..27952ff6f8a --- /dev/null +++ b/P/pandoc_crossref/build_tarballs.jl @@ -0,0 +1,48 @@ +using BinaryBuilder + +# Collection of pre-build pandoc binaries +name = "pandoc-crossref" + +# Actually, this should be v"0.3.6.4". +version = v"0.3.6" +crossref_ver = "0.3.6.4" + +url_prefix = "https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.6.4/pandoc-crossref-" +sources = [ + ArchiveSource("$url_prefix-Linux-$crossref_ver.tar.xz", "57e8f71d46c401daf0a3247b7405b49503b836e93893730e6e5907f6cb2c0885"; unpack_target = "x86_64-linux-gnu"), + ArchiveSource("$url_prefix-macOS-$crossref_ver.tar.xz", "b63ac830d7164279eb80041cd5f793e6b611ce1a701a86308ce5b2a3a99d33b2"; unpack_target = "x86_64-apple-darwin14"), + ArchiveSource("$url_prefix-Windows-$crossref_ver.tar.xz", "3e943fcdd3f91951fe18f9900e136ccb9ea810b2582f4bd929760357eaf83ef4"; unpack_target = "x86_64-w64-mingw32"), + FileSource("https://raw.githubusercontent.com/lierdakil/pandoc-crossref/65858c01a76f75990e7e30bcdb571cd84a69d47c/LICENSE", "39db8f9acf036595a2566ea3fe560bc7bd65d8749f088e0f4a4ef2f8a6cb4b34"), +] + +# Bash recipe for building across all platforms +script = raw""" +cd ${WORKSPACE}/srcdir/ +mkdir -p "${bindir}" +if [[ "${target}" != *-mingw* ]]; then + subdir="bin/" +fi +cp ${target}/pandoc-crossref/${subdir}pandoc-crossref${exeext} ${bindir} +chmod +x ${bindir}/pandoc-crossref +install_license LICENSE +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = [ + Platform("x86_64", "linux"), + Platform("x86_64", "macos"), + Platform("x86_64", "windows"), +] + +# The products that we will ensure are always built +products = [ + ExecutableProduct("pandoc-crossref", :pandoc_crossref), +] + +# Dependencies that must be installed before this package can be built +dependencies = Dependency[ +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) From 8fcf557b55f74eb96e23c3ae9437397e227d74da Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Wed, 10 Mar 2021 21:10:31 +0100 Subject: [PATCH 2/3] Fix some details --- P/pandoc_crossref/build_tarballs.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/P/pandoc_crossref/build_tarballs.jl b/P/pandoc_crossref/build_tarballs.jl index 27952ff6f8a..0f0dfa59250 100644 --- a/P/pandoc_crossref/build_tarballs.jl +++ b/P/pandoc_crossref/build_tarballs.jl @@ -6,12 +6,14 @@ name = "pandoc-crossref" # Actually, this should be v"0.3.6.4". version = v"0.3.6" crossref_ver = "0.3.6.4" +pandoc_ver = "2.9.2.1" -url_prefix = "https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.6.4/pandoc-crossref-" +url_prefix = "https://github.com/lierdakil/pandoc-crossref/releases/download/v$crossref_ver/pandoc-crossref" sources = [ - ArchiveSource("$url_prefix-Linux-$crossref_ver.tar.xz", "57e8f71d46c401daf0a3247b7405b49503b836e93893730e6e5907f6cb2c0885"; unpack_target = "x86_64-linux-gnu"), - ArchiveSource("$url_prefix-macOS-$crossref_ver.tar.xz", "b63ac830d7164279eb80041cd5f793e6b611ce1a701a86308ce5b2a3a99d33b2"; unpack_target = "x86_64-apple-darwin14"), - ArchiveSource("$url_prefix-Windows-$crossref_ver.tar.xz", "3e943fcdd3f91951fe18f9900e136ccb9ea810b2582f4bd929760357eaf83ef4"; unpack_target = "x86_64-w64-mingw32"), + ArchiveSource("$url_prefix-Linux-$pandoc_ver.tar.xz", "57e8f71d46c401daf0a3247b7405b49503b836e93893730e6e5907f6cb2c0885"; unpack_target = "x86_64-linux-gnu"), + ArchiveSource("$url_prefix-macOS-$pandoc_ver.tar.xz", "b63ac830d7164279eb80041cd5f793e6b611ce1a701a86308ce5b2a3a99d33b2"; unpack_target = "x86_64-apple-darwin14"), + # Unknown archive format. + # ArchiveSource("$url_prefix-Windows-$pandoc_ver.7z", "3e943fcdd3f91951fe18f9900e136ccb9ea810b2582f4bd929760357eaf83ef4"; unpack_target = "x86_64-w64-mingw32"), FileSource("https://raw.githubusercontent.com/lierdakil/pandoc-crossref/65858c01a76f75990e7e30bcdb571cd84a69d47c/LICENSE", "39db8f9acf036595a2566ea3fe560bc7bd65d8749f088e0f4a4ef2f8a6cb4b34"), ] @@ -32,7 +34,7 @@ install_license LICENSE platforms = [ Platform("x86_64", "linux"), Platform("x86_64", "macos"), - Platform("x86_64", "windows"), + # Platform("x86_64", "windows"), ] # The products that we will ensure are always built From e0a52b70f77a94ac199279057f5e8891c3c7f692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 10 Mar 2021 22:47:35 +0000 Subject: [PATCH 3/3] [pandoc_crossref] Fix for Windows --- P/pandoc_crossref/build_tarballs.jl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/P/pandoc_crossref/build_tarballs.jl b/P/pandoc_crossref/build_tarballs.jl index 0f0dfa59250..7497dc9df1a 100644 --- a/P/pandoc_crossref/build_tarballs.jl +++ b/P/pandoc_crossref/build_tarballs.jl @@ -1,19 +1,18 @@ using BinaryBuilder # Collection of pre-build pandoc binaries -name = "pandoc-crossref" +name = "pandoc_crossref" # Actually, this should be v"0.3.6.4". version = v"0.3.6" crossref_ver = "0.3.6.4" pandoc_ver = "2.9.2.1" -url_prefix = "https://github.com/lierdakil/pandoc-crossref/releases/download/v$crossref_ver/pandoc-crossref" +url_prefix = "https://github.com/lierdakil/pandoc-crossref/releases/download/v$(crossref_ver)/pandoc-crossref" sources = [ - ArchiveSource("$url_prefix-Linux-$pandoc_ver.tar.xz", "57e8f71d46c401daf0a3247b7405b49503b836e93893730e6e5907f6cb2c0885"; unpack_target = "x86_64-linux-gnu"), - ArchiveSource("$url_prefix-macOS-$pandoc_ver.tar.xz", "b63ac830d7164279eb80041cd5f793e6b611ce1a701a86308ce5b2a3a99d33b2"; unpack_target = "x86_64-apple-darwin14"), - # Unknown archive format. - # ArchiveSource("$url_prefix-Windows-$pandoc_ver.7z", "3e943fcdd3f91951fe18f9900e136ccb9ea810b2582f4bd929760357eaf83ef4"; unpack_target = "x86_64-w64-mingw32"), + ArchiveSource("$(url_prefix)-Linux-$(pandoc_ver).tar.xz", "57e8f71d46c401daf0a3247b7405b49503b836e93893730e6e5907f6cb2c0885"; unpack_target = "x86_64-linux-gnu"), + ArchiveSource("$(url_prefix)-macOS-$(pandoc_ver).tar.xz", "b63ac830d7164279eb80041cd5f793e6b611ce1a701a86308ce5b2a3a99d33b2"; unpack_target = "x86_64-apple-darwin14"), + FileSource("$(url_prefix)-Windows-$(pandoc_ver).7z", "3e943fcdd3f91951fe18f9900e136ccb9ea810b2582f4bd929760357eaf83ef4"; filename = "x86_64-w64-mingw32"), FileSource("https://raw.githubusercontent.com/lierdakil/pandoc-crossref/65858c01a76f75990e7e30bcdb571cd84a69d47c/LICENSE", "39db8f9acf036595a2566ea3fe560bc7bd65d8749f088e0f4a4ef2f8a6cb4b34"), ] @@ -21,11 +20,12 @@ sources = [ script = raw""" cd ${WORKSPACE}/srcdir/ mkdir -p "${bindir}" -if [[ "${target}" != *-mingw* ]]; then - subdir="bin/" +subdir="${target}" +if [[ "${target}" == *-mingw* ]]; then + 7z x "${target}" + subdir="windows-build" fi -cp ${target}/pandoc-crossref/${subdir}pandoc-crossref${exeext} ${bindir} -chmod +x ${bindir}/pandoc-crossref +install -m 755 "${subdir}/pandoc-crossref${exeext}" "${bindir}/pandoc-crossref${exeext}" install_license LICENSE """ @@ -34,7 +34,7 @@ install_license LICENSE platforms = [ Platform("x86_64", "linux"), Platform("x86_64", "macos"), - # Platform("x86_64", "windows"), + Platform("x86_64", "windows"), ] # The products that we will ensure are always built @@ -43,7 +43,8 @@ products = [ ] # Dependencies that must be installed before this package can be built -dependencies = Dependency[ +dependencies = [ + HostBuildDependency("p7zip_jll"), ] # Build the tarballs, and possibly a `build.jl` as well.