Date: Monday, February 20, 2023 @ 15:00:06 Author: orhun Revision: 1403073
addpkg: zls 0.10.0-2 Added: zls/ zls/repos/ zls/trunk/ zls/trunk/PKGBUILD zls/trunk/pie-opt.patch zls/trunk/trunk/ ---------------+ PKGBUILD | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pie-opt.patch | 33 +++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) Added: zls/trunk/PKGBUILD =================================================================== --- zls/trunk/PKGBUILD (rev 0) +++ zls/trunk/PKGBUILD 2023-02-20 15:00:06 UTC (rev 1403073) @@ -0,0 +1,59 @@ +# Maintainer: Orhun Parmaksız <[email protected]> +# Contributor: Chocobo1 <chocobo1 AT archlinux DOT net> + +pkgname=zls +pkgver=0.10.0 +_gitcommit=7ef224467ab2f3179058981740e942977892e7b9 +pkgrel=2 +pkgdesc="A language server for Zig" +arch=('x86_64') +url="https://github.com/zigtools/zls" +license=('MIT') +makedepends=('zig' 'git') +source=( + "${pkgname}::git+$url#commit=$_gitcommit" + "${pkgname}-known-folders::git+https://github.com/ziglibs/known-folders" + "${pkgname}-tracy::git+https://github.com/wolfpld/tracy" + "pie-opt.patch" +) +sha256sums=('SKIP' + 'SKIP' + 'SKIP' + 'c8241efa5da3dc263b655acc5ae76d56577802693eb62c0cfb0e0ed8b88af08f') + +prepare() { + cd "${pkgname}" + patch -Np1 -i "../pie-opt.patch" + git submodule init + git config submodule."src/known-folders".url "${srcdir}/${pkgname}"-known-folders + git config submodule."src/tracy".url "${srcdir}/${pkgname}"-tracy + git -c protocol.file.allow=always submodule update --init --recursive +} + +build() { + cd "$pkgname" + DESTDIR="build" zig build \ + --prefix /usr \ + --search-prefix /usr \ + -Dtarget=native-linux.5.15-gnu \ + -Dcpu=baseline \ + -Drelease-safe \ + -Dpie=true +} + +check() { + cd "$pkgname" + zig build test \ + -Dtarget=native-linux.5.15-gnu \ + -Dcpu=baseline \ + -Drelease-safe +} + +package() { + cd "$pkgname" + cp -a build/* "$pkgdir" + install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname" + install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" +} + +# vim: ts=2 sw=2 et: Added: zls/trunk/pie-opt.patch =================================================================== --- zls/trunk/pie-opt.patch (rev 0) +++ zls/trunk/pie-opt.patch 2023-02-20 15:00:06 UTC (rev 1403073) @@ -0,0 +1,33 @@ +diff --git a/build.zig b/build.zig +index 1d33de7..f19c880 100644 +--- a/build.zig ++++ b/build.zig +@@ -17,6 +17,7 @@ pub fn build(b: *std.build.Builder) !void { + const exe_options = b.addOptions(); + exe.addOptions("build_options", exe_options); + ++ const pie = b.option(bool, "pie", "Build a Position Independent Executable") orelse false; + const enable_tracy = b.option(bool, "enable_tracy", "Whether tracy should be enabled.") orelse false; + const coverage = b.option(bool, "generate_coverage", "Generate coverage data with kcov") orelse false; + const coverage_output_dir = b.option([]const u8, "coverage_output_dir", "Output directory for coverage data") orelse b.pathJoin(&.{b.install_prefix, "kcov"}); +@@ -33,6 +34,12 @@ pub fn build(b: *std.build.Builder) !void { + b.option(std.log.Level, "log_level", "The Log Level to be used.") orelse .info, + ); + ++ exe_options.addOption( ++ bool, ++ "pie", ++ pie, ++ ); ++ + exe_options.addOption( + bool, + "enable_tracy", +@@ -115,6 +122,7 @@ pub fn build(b: *std.build.Builder) !void { + + exe.setTarget(target); + exe.setBuildMode(mode); ++ exe.pie = pie; + exe.install(); + + const test_step = b.step("test", "Run all the tests");
