diff --git a/lib/buildsystems/autotools.rb b/lib/buildsystems/autotools.rb index 0fee5458b..476dd1c1a 100644 --- a/lib/buildsystems/autotools.rb +++ b/lib/buildsystems/autotools.rb @@ -10,6 +10,7 @@ class Autotools < Package def self.build @autotools_build_relative_dir ||= '.' extend ReportBuildsystemMethods + print_buildsystem_methods Dir.chdir(@autotools_build_relative_dir) do diff --git a/lib/buildsystems/cmake.rb b/lib/buildsystems/cmake.rb index 03d13c5d1..98b10441f 100644 --- a/lib/buildsystems/cmake.rb +++ b/lib/buildsystems/cmake.rb @@ -10,6 +10,7 @@ class CMake < Package @crew_cmake_options = @no_lto ? CREW_CMAKE_OPTIONS.gsub('-ffat-lto-objects', '').gsub('-flto=auto', '').sub('-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE', '') : CREW_CMAKE_OPTIONS extend ReportBuildsystemMethods + print_buildsystem_methods system "#{@pre_cmake_options} cmake -S #{@cmake_build_relative_dir} -B #{@cmake_build_relative_dir}/builddir -G Ninja #{@crew_cmake_options} #{@cmake_options}" diff --git a/lib/buildsystems/meson.rb b/lib/buildsystems/meson.rb index f7c7d225f..42034ef96 100644 --- a/lib/buildsystems/meson.rb +++ b/lib/buildsystems/meson.rb @@ -10,6 +10,7 @@ class Meson < Package @crew_meson_options = @no_lto ? CREW_MESON_OPTIONS.sub('-Db_lto=true', '-Db_lto=false') : CREW_MESON_OPTIONS extend ReportBuildsystemMethods + print_buildsystem_methods system "#{@pre_meson_options} meson setup #{@crew_meson_options} #{@meson_options} #{@meson_build_relative_dir}/builddir #{@meson_build_relative_dir}" diff --git a/lib/buildsystems/perl.rb b/lib/buildsystems/perl.rb index deec84b20..5cbdc9d39 100644 --- a/lib/buildsystems/perl.rb +++ b/lib/buildsystems/perl.rb @@ -7,6 +7,7 @@ class PERL < Package def self.prebuild extend ReportBuildsystemMethods + print_buildsystem_methods system "#{@pre_perl_options} perl Makefile.PL" diff --git a/lib/buildsystems/pip.rb b/lib/buildsystems/pip.rb index cdddb777e..84062be2c 100644 --- a/lib/buildsystems/pip.rb +++ b/lib/buildsystems/pip.rb @@ -39,6 +39,7 @@ class Pip < Package def self.install extend ReportBuildsystemMethods + print_buildsystem_methods @pip_cache_dir = `pip cache dir`.chomp diff --git a/lib/buildsystems/python.rb b/lib/buildsystems/python.rb index 693859405..f860c73f6 100644 --- a/lib/buildsystems/python.rb +++ b/lib/buildsystems/python.rb @@ -7,6 +7,7 @@ class Python < Package def self.build extend ReportBuildsystemMethods + print_buildsystem_methods @python_build_relative_dir ||= '.' diff --git a/lib/buildsystems/qmake.rb b/lib/buildsystems/qmake.rb index d421e94b8..c92c65aae 100644 --- a/lib/buildsystems/qmake.rb +++ b/lib/buildsystems/qmake.rb @@ -7,6 +7,7 @@ class Qmake < Package def self.build extend ReportBuildsystemMethods + print_buildsystem_methods system "QMAKE_CXX='g++ #{File.join(CREW_LIB_PREFIX, 'libC.so.6').to_s if ARCH == 'x86_64' && Gem::Version.new(LIBC_VERSION.to_s) >= Gem::Version.new('2.35')}' qmake" diff --git a/lib/buildsystems/ruby.rb b/lib/buildsystems/ruby.rb index 2447c1048..06649d9b2 100644 --- a/lib/buildsystems/ruby.rb +++ b/lib/buildsystems/ruby.rb @@ -110,6 +110,7 @@ class RUBY < Package return unless !no_compile_needed? || @gem_binary_build_needed extend ReportBuildsystemMethods + print_buildsystem_methods Kernel.system "gem fetch #{@ruby_gem_name} --platform=ruby --version=#{@ruby_gem_version}" diff --git a/lib/buildsystems/rust.rb b/lib/buildsystems/rust.rb index 518afba5c..6e09133b5 100644 --- a/lib/buildsystems/rust.rb +++ b/lib/buildsystems/rust.rb @@ -3,21 +3,25 @@ require_relative '../require_gem' require_relative '../report_buildsystem_methods' class RUST < Package - property :rust_channel, :rust_features, :rust_install_path, :rust_options, :rust_release_profile, :rust_targets, :pre_rust_options, :rust_build_extras, :rust_install_extras + property :rust_channel, :rust_flags, :rust_features, :rust_install_path, :rust_options, :rust_packages, :rust_release_profile, :rust_targets, :pre_rust_options, :rust_build_extras, :rust_install_extras def self.build + @rustflags = "#{ENV.fetch('RUSTFLAGS', nil)} #{@rust_flags}" rust_env = { LD: 'mold', LIBRARY_PATH: CREW_LIB_PREFIX, - PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil) + PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil), + RUSTFLAGS: @rustflags }.transform_keys(&:to_s) @channel_flag = @rust_channel.to_s.empty? ? '' : "+#{@rust_channel}" @features = @rust_features.to_s.empty? ? '' : "--features #{@rust_features}" @profile = @rust_release_profile.to_s.empty? ? 'release' : @rust_release_profile @rust_install_path ||= '.' + @packages = @rust_packages.to_s.empty? ? '' : @rust_packages.split.map { |p| "--package #{p}" }.join(' ') extend ReportBuildsystemMethods + print_buildsystem_methods unless @rust_channel.to_s.empty? @@ -28,6 +32,7 @@ class RUST < Package system rust_env, "#{@pre_rust_options} cargo #{@channel_flag} fetch" system rust_env, "#{@pre_rust_options} cargo #{@channel_flag} build \ --profile=#{@profile} \ + #{@packages} \ #{@features} \ #{@rust_options}" @rust_build_extras&.call @@ -38,13 +43,13 @@ class RUST < Package { LD: 'mold', LIBRARY_PATH: CREW_LIB_PREFIX, - PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil) + PATH: "#{CREW_PREFIX}/share/cargo/bin:" + ENV.fetch('PATH', nil), + RUSTFLAGS: @rustflags }.transform_keys(&:to_s) @rust_install_path.split.each do |path| system rust_env, "cargo #{@channel_flag} install \ --profile=#{@profile} \ - --offline \ --no-track \ --path #{path} \ #{@features} \ diff --git a/manifest/armv7l/c/cargo_about.filelist b/manifest/armv7l/c/cargo_about.filelist new file mode 100644 index 000000000..aae5f4849 --- /dev/null +++ b/manifest/armv7l/c/cargo_about.filelist @@ -0,0 +1,2 @@ +/usr/local/bin/about +/usr/local/bin/cargo-about diff --git a/manifest/i686/c/cargo_about.filelist b/manifest/i686/c/cargo_about.filelist new file mode 100644 index 000000000..aae5f4849 --- /dev/null +++ b/manifest/i686/c/cargo_about.filelist @@ -0,0 +1,2 @@ +/usr/local/bin/about +/usr/local/bin/cargo-about diff --git a/manifest/x86_64/c/cargo_about.filelist b/manifest/x86_64/c/cargo_about.filelist new file mode 100644 index 000000000..aae5f4849 --- /dev/null +++ b/manifest/x86_64/c/cargo_about.filelist @@ -0,0 +1,2 @@ +/usr/local/bin/about +/usr/local/bin/cargo-about diff --git a/manifest/x86_64/z/zed.filelist b/manifest/x86_64/z/zed.filelist index ea59c4339..fa7988420 100644 --- a/manifest/x86_64/z/zed.filelist +++ b/manifest/x86_64/z/zed.filelist @@ -1,5 +1,4 @@ /usr/local/bin/zed -/usr/local/libexec/zed-editor /usr/local/share/applications/zed.desktop /usr/local/share/icons/hicolor/1024x1024/apps/zed.png /usr/local/share/icons/hicolor/512x512/apps/zed.png diff --git a/packages/cargo_about.rb b/packages/cargo_about.rb new file mode 100644 index 000000000..ff75f8c5a --- /dev/null +++ b/packages/cargo_about.rb @@ -0,0 +1,32 @@ +# Adapted from Arch Linux cargo-about PKGBUILD at: +# https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=cargo-about + +require 'buildsystems/rust' + +class Cargo_about < RUST + description 'Cargo plugin to generate list of all licenses for a crate' + homepage 'https://github.com/EmbarkStudios/cargo-about' + version '0.7.1' + license 'Apache MIT' + compatibility 'all' + source_url 'https://github.com/EmbarkStudios/cargo-about.git' + git_hashtag version + binary_compression 'tar.zst' + + binary_sha256({ + aarch64: '0c74f01d9c6327ffd3c7971a56447e7c83df5f14ed1e40a60452795747e3aadb', + armv7l: '0c74f01d9c6327ffd3c7971a56447e7c83df5f14ed1e40a60452795747e3aadb', + i686: '8038a9cfaf806775f03ab9bf02d8caab93758508be712caa82a0a171eeca2ae8', + x86_64: '64646e7fca526ae51f654c15d85ab0156b2dfbdc33a9a5b77e4ccc1d639d4984' + }) + + depends_on 'gcc_lib' # R + depends_on 'glibc' # R + depends_on 'rust' => :build + + rust_install_extras do + Dir.chdir("#{CREW_DEST_PREFIX}/bin") do + FileUtils.ln_s 'cargo-about', 'about' + end + end +end diff --git a/packages/zed.rb b/packages/zed.rb index 9de8d9056..1db40ad5e 100644 --- a/packages/zed.rb +++ b/packages/zed.rb @@ -1,33 +1,51 @@ -require 'package' +require 'buildsystems/rust' -class Zed < Package +class Zed < RUST description 'Zed is a high-performance, multiplayer code editor' homepage 'https://zed.dev/' - version '0.186.12' + version '0.196.6' license 'GPL-3, AGPL-3, Apache-2.0' compatibility 'x86_64' - min_glibc '2.28' - source_url "https://github.com/zed-industries/zed/releases/download/v#{version}/zed-linux-x86_64.tar.gz" - source_sha256 '9c0abca37319d96bf8ba03653a93413011210a338acc386ddaf88d68013c1a6d' + source_url 'https://github.com/zed-industries/zed.git' + git_hashtag "v#{version}" + binary_compression 'tar.zst' - depends_on 'alsa_lib' - depends_on 'libbsd' - depends_on 'libxau' - depends_on 'libxcb' - depends_on 'libxdmcp' - depends_on 'libxkbcommon' - depends_on 'openssl' - depends_on 'zlib' - depends_on 'zstd' + binary_sha256({ + x86_64: '8320adf4460453f9e1d2baa2f7acf9326d4f0a8d011c223715dcfd1424957c76' + }) - no_compile_needed - no_shrink + depends_on 'alsa_lib' # R + depends_on 'cargo_about' => :build + depends_on 'gcc_lib' # R + depends_on 'glibc' # R + depends_on 'libbsd' # R + depends_on 'libx11' # R + depends_on 'libxau' # R + depends_on 'libxcb' # R + depends_on 'libxdmcp' # R + depends_on 'libxkbcommon' # R + depends_on 'llvm_dev' => :build + depends_on 'openssl' # R + depends_on 'ruby_solargraph' # L + depends_on 'rust' => :build + depends_on 'zlib' # R + depends_on 'zstd' # R + + rust_flags '-C link-args=-Wl,--disable-new-dtags,-rpath,$ORIGIN/../lib -C symbol-mangling-version=v0 --cfg tokio_unstable' + rust_packages 'zed' + + def self.prebuild + system 'script/generate-licenses' + end def self.install - FileUtils.mkdir_p CREW_DEST_PREFIX.to_s - FileUtils.mv 'bin/', CREW_DEST_PREFIX.to_s - FileUtils.mv 'share/', CREW_DEST_PREFIX.to_s - FileUtils.mv 'libexec/', CREW_DEST_PREFIX.to_s + system "DO_STARTUP_NOTIFY=true APP_CLI=zed APP_ICON=zed \ + APP_ARGS='%U' APP_NAME=Zed \ + envsubst < 'crates/zed/resources/zed.desktop.in' > zed.desktop" + FileUtils.install 'target/release/zed', "#{CREW_DEST_PREFIX}/bin/zed", mode: 0o755 + FileUtils.install 'zed.desktop', "#{CREW_DEST_PREFIX}/share/applications/zed.desktop", mode: 0o644 + FileUtils.install 'crates/zed/resources/app-icon.png', "#{CREW_DEST_PREFIX}/share/icons/hicolor/512x512/apps/zed.png", mode: 0o644 + FileUtils.install 'crates/zed/resources/app-icon@2x.png', "#{CREW_DEST_PREFIX}/share/icons/hicolor/1024x1024/apps/zed.png", mode: 0o644 end def self.postinstall diff --git a/tools/packages.yaml b/tools/packages.yaml index fdf55e0ae..4169724b4 100644 --- a/tools/packages.yaml +++ b/tools/packages.yaml @@ -825,6 +825,11 @@ url: https://github.com/sindresorhus/caprine/releases activity: low --- kind: url +name: cargo_about +url: https://github.com/EmbarkStudios/cargo-about/releases +activity: medium +--- +kind: url name: cargo_c url: https://github.com/lu-zero/cargo-c/releases activity: high