Commit Graph

9 Commits

Author SHA1 Message Date
pancaek
4467a2111e apache-directory-studio: move icon to spec-compliant location 2026-02-15 22:43:21 -08:00
quantenzitrone
626f23ce26 various: switch packages to use finalAttrs
this shouldn't create any rebuilds

the following script was used to generate this:
```fish
#!/usr/bin/env fish

# nix shell .#nixfmt nixpkgs#{nixf-diagnose,ripgrep,sd}

set base (git rev-parse HEAD)

set scope pkgs/by-name

set files (rg --files-with-matches -F 'stdenv.mkDerivation rec {' $scope | sort -u)

for file in $files
    echo $file
    sd -F 'stdenv.mkDerivation rec {' 'stdenv.mkDerivation (finalAttrs: {' $file
    # version
    sd -F 'version}' 'finalAttrs.version}' $file
    sd -F '${version' '${finalAttrs.version' $file
    sd -F '= version' '= finalAttrs.version' $file
    sd -F 'inherit version;' 'inherit (finalAttrs) version;' $file
    sd -F ' + version;' ' + finalAttrs.version;' $file
    sd 'replaceStrings (.*) version' 'replaceStrings $1 finalAttrs.version' $file
    sd -F 'splitVersion version' 'splitVersion finalAttrs.version' $file
    sd -F 'versionAtLeast version' 'versionAtLeast finalAttrs.version' $file
    sd 'versions\.([a-z]+) version' 'versions.$1 finalAttrs.version' $file
    # src
    sd -F 'src}' 'finalAttrs.src}' $file
    sd -F '${src' '${finalAttrs.src' $file
    sd -F '= src' '= finalAttrs.src' $file
    sd -F 'inherit src;' 'inherit (finalAttrs) src;' $file
    sd -F 'inherit (src' 'inherit (finalAttrs.src' $file
    # meta
    sd -F '${meta' '${finalAttrs.meta' $file
    sd -F '= meta' '= finalAttrs.meta' $file
    sd -F 'inherit (meta' 'inherit (finalAttrs.meta' $file
    # other
    sd -F 'inherit version src;' 'inherit (finalAttrs) version src;' $file
    sd -F 'makeLibraryPath buildInputs' 'makeLibraryPath finalAttrs.buildInputs' $file
    sd -F 'buildInputs}' 'finalAttrs.buildInputs}' $file
    sd -F 'desktopItem}' 'finalAttrs.desktopItem}' $file
    sd -F 'runtimeLibs}' 'finalAttrs.runtimeLibs}' $file
    sd -F 'libPath}' 'finalAttrs.libPath}' $file
    sd -F 'runtimeDependencies}' 'finalAttrs.runtimeDependencies}' $file
    sd -F 'nativeRuntimeInputs}' 'finalAttrs.nativeRuntimeInputs}' $file
    sd -F '(!doCheck)' '(!finalAttrs.doCheck)' $file
    sd -F 'optional doCheck' 'optional finalAttrs.doCheck' $file
    sd -F 'optionals doCheck' 'optionals finalAttrs.doCheck' $file
    sd -F '++ runtimeDependencies' '++ finalAttrs.runtimeDependencies' $file
    # pname (restored afterwards)
    sd -F 'pname}' 'finalAttrs.pname}' $file
    sd -F '${pname' '${finalAttrs.pname' $file
    sd -F '= pname' '= finalAttrs.pname' $file
    # close finalAttrs lambda
    echo ')' >>$file
    # catch some errors early
    if ! nixfmt $file
        git restore $file
        continue
    end
    if ! nixf-diagnose -i sema-primop-overridden $file
        git restore $file
        continue
    end
end

set torestore (rg -F .finalAttrs --files-with-matches $scope)
if test (count $torestore) -gt 0
    git restore $torestore
end
set torestore (rg -F finalAttrs.pname --files-with-matches $scope)
if test (count $torestore) -gt 0
    git restore $torestore
end

# commit for faster eval times
git add pkgs
git commit --no-gpg-sign -m temp
set torestore

for file in $files
    # file hasn't changed
    if git diff --quiet $base $file
        continue
    end
    # try to eval the package to definitely catch all errors
    echo $file
    set pname (string split / $file -f 4)
    if ! nix eval .#$pname
        set torestore $torestore $file
    end
end

# restore files that don't eval
git reset --soft $base
git restore --staged .
if test (count $torestore) -gt 0
    git restore $torestore
end
```

after that some manual cleanup was done:
- restoring files that cause changes in the number of lines
- restoring files that cause rebuilds
- restoring files that cause merge conflicts with staging
2026-02-07 09:59:05 +01:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Grimmauld
cd062f040e treewide: update to webkitgtk_4_1 where possible
Methodology:
- `sed` to find and replace in pkgs/*
- exclude pkgs/top-level
- nixpkgs-review on x86_64-linux and aarch64-linux
- revert everything that doesn't build
- revert everything that doesn't launch [x86_64-linux]
- check upstream source whether the change makes sense [free software only]
2025-04-22 16:52:29 +02:00
Bjørn Forsman
d5a5652917 apache-directory-studio: remove redundant parenthesis 2025-03-07 17:22:36 +01:00
Bjørn Forsman
b707af9ad1 apache-directory-studio: fix startup by creating /tmp/SWT-GDBusServer
Before:

  $ ./result/bin/ApacheDirectoryStudio
  SWT WebKitGDBus: error creating DBus server Error binding to address (GUnixSocketAddress): No such file or directory
  SWT WebKit: error initializing DBus server, dBusServer == 0

  (Apache Directory Studio:1218305): GLib-GIO-CRITICAL **: 15:17:33.727: g_dbus_server_get_client_address: assertion 'G_IS_DBUS_SERVER (server)' failed
  #
  # A fatal error has been detected by the Java Runtime Environment:
  #
  #  SIGSEGV (0xb) at pc=0x00007fe033c36f48, pid=1218305, tid=1218306
  #
  # JRE version: OpenJDK Runtime Environment (21.0.5+1) (build 21.0.5+1-nixos)
  # Java VM: OpenJDK 64-Bit Server VM (21.0.5+1-nixos, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
  # Problematic frame:
  # C  [libswt-gtk-4940r23.so+0x36f48]  Java_org_eclipse_swt_internal_C_strlen+0xf
  #
  # Core dump will be written. Default location: Core dumps may be processed with "/nix/store/jz45idky1nhvf3c9gz20ds2py19kdvgf-systemd/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/bf/nixpkgs/core.1218305)
  #
  # An error report file with more information is saved as:
  # /home/bf/nixpkgs/hs_err_pid1218305.log
  [2.073s][warning][os] Loading hsdis library failed
  #
  # If you would like to submit a bug report, please visit:
  #   https://bugreport.java.com/bugreport/crash.jsp
  # The crash happened outside the Java Virtual Machine in native code.
  # See problematic frame for where to report the bug.
  #

After:

  $ ./result/bin/ApacheDirectoryStudio
  ** (WebKitWebProcess:1221467): ERROR **: 15:18:35.064: Failed to create server: Error binding to address (GUnixSocketAddress): No such file or directory

...but the GUI opens and the application seems fine.
Tested on NixOS with GNOME (Wayland).

Fixes https://github.com/nixos/nixpkgs/issues/333377.
2025-03-07 17:22:36 +01:00
Bjørn Forsman
83d69521ca apache-directory-studio: add missing glib
Fix loading the SWT library by adding glib to the runtime library
search path.

Before:

  $ ./result/bin/ApacheDirectoryStudio
  ApacheDirectoryStudio:
  An error has occurred. See the log file
  /home/bf/.eclipse/1900982865_linux_gtk_x86_64/configuration/1740319909191.log.

where the log file contains

  !SESSION 2025-02-23 15:11:49.037 -----------------------------------------------
  eclipse.buildId=unknown
  java.version=21.0.5
  java.vendor=N/A
  BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
  Framework arguments:  /studio-rcp/resources/icons/linux/studio.xpm
  Command-line arguments:  -os linux -ws gtk -arch x86_64 /studio-rcp/resources/icons/linux/studio.xpm

  !ENTRY org.eclipse.osgi 4 0 2025-02-23 15:11:49.771
  !MESSAGE Application error
  !STACK 1
  java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
  	no swt-pi4-gtk-4940r23 in java.library.path: /nix/store/l1rnlmalihpfg7aj9lxh4mv5ffnqx6qi-webkitgtk-2.46.6+abi=4.0/lib:/etc/sane-libs:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
  	no swt-pi4-gtk in java.library.path: /nix/store/l1rnlmalihpfg7aj9lxh4mv5ffnqx6qi-webkitgtk-2.46.6+abi=4.0/lib:/etc/sane-libs:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
  	Can't load library: /home/bf/.swt/lib/linux/x86_64/libswt-pi4-gtk-4940r23.so
  	Can't load library: /home/bf/.swt/lib/linux/x86_64/libswt-pi4-gtk.so

  	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:338)
  	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:257)
  	at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:96)
  	at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209)
  	at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155)
  	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:163)
  	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:726)
  	at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:168)
  	at org.apache.directory.studio.Application.start(Application.java:47)
  	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
  	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
  	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
  	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
  	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
  	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
  	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
  	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

It's worth noting, that when the program fails to load
libswt-pi4-gtk-*.so, it has libswt-pi3-gtk-*.so available (it is put
there by the application):

  $ tree ~/.swt
  /home/bf/.swt
  └── lib
      └── linux
          └── x86_64
              └── libswt-pi3-gtk-4940r23.so

After:

  (a different runtime error, possibly only seen on some DEs -- will be
  fixed in next commit)
2025-03-07 17:22:36 +01:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
aleksana
571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00