Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Port libarchive to CMake #2602

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
72 changes: 38 additions & 34 deletions libarchive/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

pkgname=('libarchive' 'libarchive-devel' 'bsdcpio' 'bsdtar')
pkgver=3.5.1
pkgrel=1
pkgrel=2
pkgdesc="library that can create and read several streaming archive formats"
arch=('i686' 'x86_64')
url="https://libarchive.org/"
license=('BSD')
groups=('libraries')
depends=('gcc-libs' 'libbz2' 'libiconv' 'libexpat' 'liblzma' 'liblz4' 'libnettle' 'libxml2' 'libzstd' 'zlib')
makedepends=('libbz2-devel' 'libiconv-devel' 'libexpat-devel' 'liblzma-devel' 'liblz4-devel' 'libnettle-devel' 'libxml2-devel' 'libzstd-devel' 'zlib-devel')
options=('!strip' 'debug' 'libtool')
makedepends=('libbz2-devel' 'libiconv-devel' 'libexpat-devel' 'liblzma-devel' 'liblz4-devel' 'libnettle-devel'
'libxml2-devel' 'libzstd-devel' 'zlib-devel' 'cmake' 'ninja')
source=("https://github.com/libarchive/libarchive/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz"
'libarchive-3.3.2-bcrypt-fix.patch'
'libarchive-3.3.1-msys2.patch')
Expand All @@ -24,46 +24,34 @@ prepare() {
# msysize patch
#patch -Np1 -i "${srcdir}/libarchive-3.3.1-msys2.patch"
patch -Np1 -i "${srcdir}/libarchive-3.3.2-bcrypt-fix.patch"
autoreconf -ivf
}

build() {
export lt_cv_deplibs_check_method='pass_all'
cd "${pkgname}-${pkgver}"

./configure \
--prefix=/usr \
--enable-shared \
--enable-static \
--without-libiconv-prefix \
--without-xml2 \
--without-cng \
--without-lzo2
local build_type=Release
Biswa96 marked this conversation as resolved.
Show resolved Hide resolved
if check_option "debug" "y"; then
build_type=Debug
fi

# CNG breaks pacman on Vista due to BCryptDeriveKeyPBKDF2

make
make DESTDIR="${srcdir}/dest" install
}
#export lt_cv_deplibs_check_method='pass_all'

check() {
cd "${pkgname}-${pkgver}"
mkdir -p "${pkgname}-${pkgver}/build-${CHOST}"
cd "${pkgname}-${pkgver}/build-${CHOST}"

make check || true
}
cmake \
-G"Ninja" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=$build_type \
-DENABLE_TAR_SHARED=ON \
-DENABLE_CPIO_SHARED=ON \
-DENABLE_CAT_SHARED=ON \
..

package_bsdcpio() {
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/usr/share/man/man1/
cp -f ${srcdir}/dest/usr/bin/bsdcpio.exe ${pkgdir}/usr/bin/
cp -f ${srcdir}/dest/usr/share/man/man1/bsdcpio.* ${pkgdir}/usr/share/man/man1/
cmake --build .
DESTDIR="${srcdir}/dest" cmake --install .
}

package_bsdtar() {
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/usr/share/man/man1/
cp -f ${srcdir}/dest/usr/bin/bsdtar.exe ${pkgdir}/usr/bin/
cp -f ${srcdir}/dest/usr/share/man/man1/bsdtar.* ${pkgdir}/usr/share/man/man1/
check() {
cd "${pkgname}-${pkgver}/build-${CHOST}"
}

package_libarchive() {
Expand All @@ -82,3 +70,19 @@ package_libarchive-devel() {
cp -rf ${srcdir}/dest/usr/include ${pkgdir}/usr/
cp -rf ${srcdir}/dest/usr/lib ${pkgdir}/usr/
}

package_bsdcpio() {
depends=("libarchive=${pkgver}")
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/usr/share/man/man1/
cp -f ${srcdir}/dest/usr/bin/bsdcpio.exe ${pkgdir}/usr/bin/
cp -f ${srcdir}/dest/usr/share/man/man1/bsdcpio.* ${pkgdir}/usr/share/man/man1/
}

package_bsdtar() {
depends=("libarchive=${pkgver}")
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/usr/share/man/man1/
cp -f ${srcdir}/dest/usr/bin/bsdtar.exe ${pkgdir}/usr/bin/
cp -f ${srcdir}/dest/usr/share/man/man1/bsdtar.* ${pkgdir}/usr/share/man/man1/
}