summaryrefslogblamecommitdiff
path: root/user/horizon/APKBUILD
blob: 4d035e184f251f5ed51dfdb33412e5f63f65e2fe (plain) (tree)
1
2
3
4
5
6
7
8
9


                                                  
            
        


                                              
                                                                







                                                                       
                                                                               
                                       


                                                                       








































                                                                                          
                        

                                     
                                               


                                                                    
                                                                          



                                                            
                         



















                                                                          




                                      

                                                                                                                                                                  
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=horizon
pkgver=0.9.1
pkgrel=1
pkgdesc="Installation tools for Adélie Linux"
url="https://horizon.adelielinux.org/"
arch="all"
options="!archcheck !check"  # Unpackaged dependency ruby-aruba.
license="AGPL-3.0+"
depends=""
checkdepends="ruby-aruba ruby-rspec valgrind"
# Second group is the Qt5 UI deps.
makedepends="bcnm-dev boost-dev cmake curl-dev eudev-dev libarchive-dev
	linux-headers parted-dev skalibs-dev util-linux-dev

	libcap-dev libx11-dev libxkbfile-dev qt5-qtbase-dev"
subpackages="$pkgname-image $pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-qt5
	$pkgname-tools $pkgname-wizard"
source="https://distfiles.adelielinux.org/source/horizon-$pkgver.tar.xz
	fix-qt-runner.patch
	"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DBUILD_TOOLS=ON \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-format-truncation" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DINSTALL=ON \
		${CMAKE_CROSSOPTS} \
		-Bbuild
	make -C build

	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=False \
		-DBUILD_TOOLS=OFF \
		-DBUILD_UI=ON \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-format-truncation" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DINSTALL=OFF \
		${CMAKE_CROSSOPTS} \
		-Bbuild-wizard
	make -C build-wizard
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE make -C build test
}

package() {
	make DESTDIR="$pkgdir" -C build install
}

image() {
	pkgdesc="Tools for generating images using HorizonScript"
	depends="mtools"
	mkdir -p "$subpkgdir"/usr/bin
	mkdir -p "$subpkgdir"/usr/lib
	mkdir -p "$subpkgdir"/usr/share/horizon

	mv "$pkgdir"/usr/bin/hscript-image "$subpkgdir"/usr/bin/
	mv "$pkgdir"/usr/lib/libhi-backends.so "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/share/horizon/iso "$subpkgdir"/usr/share/horizon/
}

qt5() {
	pkgdesc="Qt 5 installation wizard for Adélie Linux"
	depends="horizon"
	mkdir -p "$subpkgdir"/usr/bin

	for _bin in horizon-ppc64-detect horizon-qt5 horizon-run-qt5; do
		mv "$pkgdir"/usr/bin/$_bin "$subpkgdir"/usr/bin/
	done
}

tools() {
	pkgdesc="Tools for authoring HorizonScript files"
	mkdir -p "$subpkgdir"/usr/bin

	for _bin in hscript-fromjson hscript-simulate hscript-validate; do
		mv "$pkgdir"/usr/bin/$_bin "$subpkgdir"/usr/bin/
	done
}

wizard() {
	pkgdesc="Wizard to generate a HorizonScript for another computer"

	make DESTDIR="$subpkgdir" -C "$builddir"/build-wizard install
	rm -r "$subpkgdir"/usr/include
	rm -r "$subpkgdir"/usr/lib
	rm -r "$subpkgdir"/usr/share
}

sha512sums="fe8f58a232b7e577aeba62cecfd97bec4037d41dd179781af912c9974210ce4648b0c56bd84fbf78866698e91882b8f4b7168c22842bde1682ea118ca931832f  horizon-0.9.1.tar.xz
78d1a1bca7d12a189d506e1fcc42ea0ab968ed3cb9ada7e95fab6256ea2e0cb820d9b41cdd858e22da37a63f899918fe40c00bcd2d67dea81e3a9ce30570ad46  fix-qt-runner.patch"