mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 20:46:39 +02:00
154 lines
4.1 KiB
Text
154 lines
4.1 KiB
Text
# Maintainer: Celeste <cielesti@protonmail.com>
|
|
maintainer="Celeste <cielesti@protonmail.com>"
|
|
pkgname=cpdf
|
|
pkgver=2.8
|
|
pkgrel=0
|
|
pkgdesc="Coherent PDF command line tools"
|
|
url="https://community.coherentpdf.com/"
|
|
# riscv64, loongarch64: ocaml & ocaml-findlib unavailable
|
|
arch="all !riscv64 !loongarch64"
|
|
license="AGPL-3.0-or-later"
|
|
makedepends="
|
|
bash
|
|
ocaml
|
|
ocaml-findlib
|
|
ocaml-ocamldoc
|
|
"
|
|
subpackages="
|
|
$pkgname-doc
|
|
ocaml-camlpdf
|
|
ocaml-cpdf
|
|
libcpdf
|
|
libcpdf-static
|
|
libcpdf-dev
|
|
"
|
|
depends_dev="libcpdf=$pkgver-r$pkgrel"
|
|
_cpdflib=ccd26dfee9da21c027a23ac4018587682e93a803
|
|
_cpdflibdir="$srcdir/cpdflib-source-$_cpdflib"
|
|
source="https://github.com/johnwhitington/cpdf-source/archive/refs/tags/v$pkgver/cpdf-source-$pkgver.tar.gz
|
|
https://github.com/johnwhitington/camlpdf/archive/refs/tags/v$pkgver/camlpdf-$pkgver.tar.gz
|
|
https://github.com/johnwhitington/cpdflib-source/archive/$_cpdflib/cpdflib-source-$_cpdflib.tar.gz
|
|
use-asmrun-pic-variant_patch
|
|
"
|
|
builddir="$srcdir/$pkgname-source-$pkgver"
|
|
|
|
# compiler produces textrels on 32-bit archs
|
|
case "$CARCH" in
|
|
arm*|x86) options="$options textrels" ;;
|
|
esac
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
mkdir -p "$tmpdir"
|
|
ln -svf "$srcdir"/camlpdf-$pkgver "$tmpdir"/camlpdf
|
|
ln -svf "$srcdir"/cpdf-source-$pkgver "$tmpdir"/cpdf
|
|
|
|
ln -svf use-asmrun-pic-variant_patch \
|
|
"$srcdir"/use-asmrun-pic-variant.patch
|
|
builddir="$_cpdflibdir" \
|
|
source="use-asmrun-pic-variant.patch" \
|
|
default_prepare
|
|
}
|
|
|
|
build() {
|
|
make -j1 -C "$srcdir/camlpdf-$pkgver"
|
|
make -j1 OCAMLPATH="$tmpdir"
|
|
make -j1 OCAMLPATH="$tmpdir" NCSUFFIX=.exe native-code
|
|
|
|
cd "$_cpdflibdir"
|
|
OCAMLPATH="$tmpdir" ./build
|
|
}
|
|
|
|
check() {
|
|
./cpdf.exe --help
|
|
|
|
cd "$_cpdflibdir"
|
|
|
|
msg "Testing shared"
|
|
CAMLPDF_REPRODUCIBLE_IDS=true \
|
|
CPDF_REPRODUCIBLE_DATES=true \
|
|
LD_LIBRARY_PATH="$_cpdflibdir" \
|
|
./cpdflibtest-withshared
|
|
|
|
# static test segfaults on 32-bit archs
|
|
case "$CARCH" in
|
|
arm*|x86) return 0 ;;
|
|
esac
|
|
|
|
msg "Testing static"
|
|
CAMLPDF_REPRODUCIBLE_IDS=true \
|
|
CPDF_REPRODUCIBLE_DATES=true \
|
|
./cpdflibtest
|
|
}
|
|
|
|
package() {
|
|
export OCAMLFIND_DESTDIR="$pkgdir/usr/lib/ocaml"
|
|
export OCAMLFIND_LDCONF=ignore
|
|
mkdir -p "$OCAMLFIND_DESTDIR/stublibs"
|
|
|
|
make -C "$srcdir"/camlpdf-$pkgver install
|
|
make install OCAMLPATH="$OCAMLFIND_DESTDIR"
|
|
|
|
install -Dvm755 cpdf.exe "$pkgdir"/usr/bin/cpdf
|
|
install -Dvm644 cpdfmanual.pdf \
|
|
"$srcdir"/camlpdf-$pkgver/introduction_to_camlpdf.pdf \
|
|
-t "$pkgdir"/usr/share/doc/$pkgname/
|
|
|
|
cd "$_cpdflibdir"
|
|
install -Dvm755 libcpdf.so -t "$pkgdir"/usr/lib/
|
|
install -Dvm644 libcpdf.a -t "$pkgdir"/usr/lib/
|
|
install -Dvm644 cpdflibwrapper.h -t "$pkgdir"/usr/include/
|
|
|
|
# Install license because cpdflibwrapper.h says "See LICENSE for details"
|
|
install -Dvm644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
}
|
|
|
|
camlpdf() {
|
|
pkgdesc="OCaml library for reading, writing, and modifying PDF files"
|
|
license="LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception"
|
|
|
|
amove \
|
|
usr/lib/ocaml/camlpdf \
|
|
usr/lib/ocaml/stublibs/dllcamlpdf*
|
|
}
|
|
|
|
cpdf() {
|
|
pkgdesc="$pkgdesc (OCaml library)"
|
|
|
|
amove usr/lib/ocaml/cpdf
|
|
}
|
|
|
|
libcpdf() {
|
|
default_libs
|
|
|
|
amove usr/lib/libcpdf.so
|
|
}
|
|
|
|
prepare_py_provides() {
|
|
local datadir="${subpkgdir:-$pkgdir}"
|
|
local pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
|
|
local controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
|
|
|
|
options_has "!tracedeps" && return 0
|
|
|
|
ocaml4-abuild-find provides \
|
|
"$datadir"/usr/lib/ocaml \
|
|
"$controldir" \
|
|
"$pkgver-r$pkgrel"
|
|
}
|
|
|
|
scan_python3_dependency() {
|
|
local controldir="$2" datadir="$3"
|
|
|
|
ocaml4-abuild-find requires \
|
|
"$datadir"/usr/lib/ocaml \
|
|
"$controldir"
|
|
}
|
|
|
|
sha512sums="
|
|
0a77525252a5acb8ac4fdcbdd1620d2e14b5309235521089c7183e73e95d0efba104e5afc3dc890a73b965d7a644d190c2b611ab39aa3fde3cfdaf651980ba6b cpdf-source-2.8.tar.gz
|
|
a1e47003876494932a4a584f8e20f9d99085044cedf418997be97198b28f49ec026e97530b691afc2722e021d19e8327a1f0155e7e231262a362d722683ac1c4 camlpdf-2.8.tar.gz
|
|
3f811f2aab469ed97a99ef731468c9ad06e1c780107b44d0fc73a8d67c6480980bab186ca6ded93c4f14b3dc657ffb0225bdda6f0e13873f1a7027798065cea6 cpdflib-source-ccd26dfee9da21c027a23ac4018587682e93a803.tar.gz
|
|
2a2469b4a584a21e6402c75a86e6e3879dd5fc8e65d08fc1d066613b5d58169408f45c4b68ea67dfe22c7f73d73f370d82cf9db0dd98fb0977008205aed49d67 use-asmrun-pic-variant_patch
|
|
"
|