summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAlex Hirzel2022-12-05 13:23:44 -0500
committerAlex Hirzel2022-12-05 13:23:44 -0500
commit6b92681001b6751d7a32530b9103ab702a05277b (patch)
tree82b1328956f13317c052c0a73bb68d98524f4729 /PKGBUILD
downloadaur-6b92681001b6751d7a32530b9103ab702a05277b.tar.gz
initial version
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD131
1 files changed, 131 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..07094cf707c6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,131 @@
+# Maintainer: Alex Hirzel <alex at hirzel period us>
+
+pkgname=luisarender-git
+pkgver=de7818a7
+pkgrel=1
+pkgdesc="High-Performance Rendering Framework on Stream Architectures"
+arch=('x86_64')
+url="https://luisa-render.com/"
+license=('BSD')
+depends=('gcc-libs' 'cuda' 'glfw-wayland')
+makedepends=('clang' 'git' 'cmake')
+source=(
+ 'git+https://github.com/LuisaGroup/LuisaRender.git'
+ 'git+https://github.com/LuisaGroup/LuisaCompute.git'
+ 'git+https://github.com/jarro2783/cxxopts.git'
+ 'git+https://github.com/assimp/assimp.git'
+ 'git+https://github.com/fastfloat/fast_float.git'
+ 'git+https://github.com/syoyo/tinyexr.git'
+
+ # for compute
+ 'git+https://github.com/Cyan4973/xxHash.git'
+ 'git+https://github.com/gabime/spdlog.git'
+ 'git+https://github.com/chriskohlhoff/asio.git'
+ 'git+https://github.com/nothings/stb.git'
+ 'git+https://github.com/nlohmann/json.git'
+ 'git+https://github.com/glfw/glfw.git'
+ 'git+https://github.com/ocornut/imgui.git'
+ 'git+https://github.com/LuisaGroup/EASTL.git'
+ 'git+https://github.com/jothepro/doxygen-awesome-css.git'
+ 'git+https://github.com/pybind/pybind11'
+ 'git+https://github.com/abseil/abseil-cpp.git'
+ 'git+https://github.com/KhronosGroup/SPIRV-Headers'
+ 'git+https://github.com/KhronosGroup/SPIRV-Tools.git'
+ 'git+https://github.com/KhronosGroup/glslang.git'
+ 'git+https://github.com/google/shaderc.git'
+
+ # submodules within compute
+ 'git+https://github.com/LuisaGroup/EABase.git'
+ 'git+https://github.com/microsoft/mimalloc.git'
+)
+
+md5sums=(
+ 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
+ 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
+ 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
+)
+
+pkgver() {
+ git -C "$srcdir/LuisaRender" describe --long --tags --always | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "$srcdir/LuisaRender"
+
+ # map submodules from sources list into the project structure
+ # this list contains folder name -> path mappings, and since there is
+ # nesting we need to be careful to 'cd' to the correct parent repository
+ # when calling "submodule update"
+ for clone_path in \
+ "LuisaCompute src/compute" \
+ "xxHash src/compute/src/ext/xxHash" \
+ "spdlog src/compute/src/ext/spdlog" \
+ "asio src/compute/src/ext/asio" \
+ "stb src/compute/src/ext/stb/stb" \
+ "json src/compute/src/ext/json" \
+ "glfw src/compute/src/ext/glfw" \
+ "imgui src/compute/src/ext/imgui/imgui" \
+ "EASTL src/compute/src/ext/EASTL" \
+ "EABase src/compute/src/ext/EASTL/packages/EABase" \
+ "mimalloc src/compute/src/ext/EASTL/packages/mimalloc" \
+ "doxygen-awesome-css src/compute/src/ext/doxygen-awesome-css" \
+ "pybi src/compute/src/ext/pybind11" \
+ "abseil-cpp src/compute/src/ext/abseil-cpp" \
+ "SPIRV-Hea src/compute/src/ext/SPIRV-Headers" \
+ "SPIRV-Tools src/compute/src/ext/SPIRV-Tools" \
+ "glslang src/compute/src/ext/glslang" \
+ "shaderc src/compute/src/ext/shaderc" \
+ "cxxopts src/ext/cxxopts" \
+ "assimp src/ext/assimp" \
+ "fast_float src/ext/fast_float" \
+ "tinyexr src/ext/tinyexr" \
+ ; do
+ clone_path=( $clone_path ); # string to array
+ clone=${clone_path[0]}; # first path from above - the cloned folder from PKGBUILD
+ full_repo_path=${clone_path[1]}; # second path from above - where it's used in git tree
+
+ # split full_repo_path into sections, e.g.
+ # [src/compute/src/ext/EASTL] / [packages/mimalloc]
+ # ^ repo_with_submodule ^ submodule_path_within_repo
+ repo_with_submodule=$(dirname $(dirname $full_repo_path))
+ submodule_path_within_repo=$(basename $(dirname $full_repo_path))/$(basename $full_repo_path)
+
+ git config submodule.$full_repo_path.url $srcdir/$clone
+ pushd $repo_with_submodule > /dev/null
+ git config submodule.$full_repo_path.url $srcdir/$clone
+ git -c protocol.file.allow=always submodule update --init $submodule_path_within_repo
+ popd > /dev/null
+ done
+}
+
+build() {
+ cmake -S "$srcdir/LuisaRender" \
+ -B "$srcdir/build" \
+ -DCMAKE_BUILD_TYPE=Release
+
+ make -C "$srcdir/build" ${MAKEFLAGS:--j1}
+}
+
+package() {
+ cd "$srcdir/build"
+
+ pkgusr="$pkgdir/usr"
+ pkglib="$pkgusr/lib/$pkgname"
+
+ cd "$srcdir/LuisaRender"
+ install -Dm644 LICENSE "$pkgusr/share/licenses/$pkgname/LICENSE"
+
+ # for now, we manually pick things out of the build folder rather than using
+ # the install.
+ cd "$srcdir/build/bin"
+ for binary_name in luisa-render-*; do
+ dest="$pkgusr/bin/$binary_name"
+ install -Dm755 $binary_name $dest
+ patchelf --set-rpath "/usr/lib/$pkgname" "$dest"
+ done
+ for so in *.so*; do
+ dest="$pkglib/$so"
+ install -Dm755 "$so" $dest
+ patchelf --set-rpath "/usr/lib/$pkgname" "$dest"
+ done
+}