summaryrefslogblamecommitdiff
path: root/user/horizon/APKBUILD
blob: 2e60a0cac5d6cecdf25583170336d890eb9f3a84 (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.8
pkgrel=0
pkgdesc="Installation tools for Adélie Linux"
url="https://horizon.adelielinux.org/"
arch="all"
options="!archcheck !check suid"  # 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 libcap-dev libx11-dev libxkbfile-dev qt5-qtbase-dev"
subpackages="$pkgname-image $pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-qt5
	$pkgname-tools $pkgname-wizard $pkgname-boot"
source="https://distfiles.adelielinux.org/source/$pkgname-$pkgver.tar.xz"

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" \
		-DUNSUPPORTED_NONFREE_FIRMWARE=ON \
		-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" \
		-DUNSUPPORTED_NONFREE_FIRMWARE=ON \
		-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="dracut mtools squashfs-tools xorriso"
	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"/etc/horizon
	mkdir -p "$subpkgdir"/usr/bin
	mkdir -p "$subpkgdir"/var/log/horizon

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

	chmod 4755 "$subpkgdir"/usr/bin/horizon-run-qt5
	chmod 1777 "$subpkgdir"/etc/horizon
	/usr/sbin/setcap cap_sys_time+ep "$subpkgdir"/usr/bin/horizon-qt5
}

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
}

boot() {
	pkgdesc="Boot to Horizon"
	depends="horizon-qt5 horizon kwin papirus-icons qt5ct sddm
	netsurf partitionmanager xterm"

	mkdir -p "$subpkgdir"/etc/init.d
	mkdir -p "$subpkgdir"/etc/profile.d
	mkdir -p "$subpkgdir"/etc/runlevels/graphical
	mkdir -p "$subpkgdir"/etc/sddm.conf.d
	mkdir -p "$subpkgdir"/etc/xdg/qt5ct
	mkdir -p "$subpkgdir"/usr/bin
	mkdir -p "$subpkgdir"/usr/share/qt5ct/qss
	mkdir -p "$subpkgdir"/usr/share/xsessions

	cat >"$subpkgdir"/etc/profile.d/horizon-qt5.sh <<PROFILE
#!/bin/sh
export QT_QUICK_BACKEND=software
export QT_QPA_PLATFORMTHEME=qt5ct
PROFILE
	chmod 755 "$subpkgdir"/etc/profile.d/horizon-qt5.sh
	cat >"$subpkgdir"/etc/xdg/kdeglobals <<GLOBALS
[General]
ColorScheme=Steel

[Icons]
Theme=Papirus

[WM]
activeBackground=104,0,0
GLOBALS

	install -D -m644 "$builddir"/boot/horizon.sddm.conf \
		"$subpkgdir"/etc/sddm.conf.d/horizon.conf

	install -D -m755 "$builddir"/boot/gfxdetect \
		"$subpkgdir"/etc/init.d/gfxdetect

	ln -s ../../init.d/gfxdetect \
		"$subpkgdir"/etc/runlevels/graphical/gfxdetect

	install -D -m755 "$builddir"/boot/start-horizon-qt5 \
		"$subpkgdir"/usr/bin/start-horizon-qt5

	install -D -m644 "$builddir"/boot/kwinrc \
		"$subpkgdir"/etc/xdg/kwinrc

	install -D -m644 "$builddir"/boot/qt5ct.conf \
		"$subpkgdir"/etc/xdg/qt5ct/qt5ct.conf
	install -D -m644 "$builddir"/boot/horizon.qss \
		"$subpkgdir"/usr/share/qt5ct/qss/horizon.qss

	install -D -m644 "$builddir"/boot/horizon-session.desktop \
		"$subpkgdir"/usr/share/xsessions/horizon.desktop
}

sha512sums="8b059f8dc729acaed61168a37204cd2405dce8d0aa27e77f3c08fa8a125d3ead039aaaa550e57d41673688ea9e8cfa2a81aff8c815e8701d467487bdfa6d47bf  horizon-0.9.8.tar.xz"