Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnome-latex: init at 3.28.1 #42325

Merged
merged 1 commit into from Jun 25, 2018
Merged

Gnome-latex: init at 3.28.1 #42325

merged 1 commit into from Jun 25, 2018

Conversation

manveru
Copy link
Contributor

@manveru manveru commented Jun 21, 2018

Motivation for this change

Package request in #42261

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking time to package this. Except for minor issues this looks quite good. One thing to consider, though, is how will the application find LaTeX tools and packages.

in stdenv.mkDerivation {
name = "amtk-${version}";
src = fetchTarball {
url = "https://gitlab.gnome.org/GNOME/amtk/-/archive/${version}/amtk-${version}.tar.bz2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably use mirror://gnome/sources/amtk/${gnome3.versionBranch version}/${name}.tar.xz, since it will be served by geographically distributed mirrors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also sorry about misinformation, we now have stdenv.lib.versions.majorMinor which should be preferred.


configurePhase = ''
mkdir -p $out
./autogen.sh --prefix=$out
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, you would use preConfigure = ''NOCONFIGURE=1 ./autogen.sh''; and let the generic builder take care of the rest.

'';

meta = with stdenv.lib; {
homepage = "https://wiki.gnome.org/Projects/Amtk";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to quote simple URLs.

gobjectIntrospection
automake
intltool
gnome2.gtkdoc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use top-level gtk-doc, this is just an alias.

sha256 = "17rbwg0v3m0myl797vrynk7wpz1fysp5px45bl7l4fpqwan2vgv8";
};

NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reported as per #36468

'';

preFixup = ''
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : $out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should already be a part of wrapGAppsHook.

];

buildInputs = [
vala
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following should go to nativeBuildInputs: vala, appstream-glib, gobjectIntrospection, gnome2.gtkdoc, gnome3.yelp-tools, itstool

mkdir -p $out
./autogen.sh --prefix=$out --disable-Werror
'';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add updateScripts as per #36150

mkdir -p $out
./autogen.sh --prefix=$out
'';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package seems to have tests, could you add doCheck = true (or doCheck = false with a TODO comment if they fail).

@manveru
Copy link
Contributor Author

manveru commented Jun 21, 2018

I already discussed in with @Mic92 about the issue of finding mklatex, but it seems like a common thing to leave providing that binary to the user, since we don't want to decide for them which latex distribution they want to use.

Some other packages provide a texLive argument where you can pass it in, but since we don't actually need it for building it seemed overkill.

@manveru
Copy link
Contributor Author

manveru commented Jun 21, 2018

two more things that worry me are these warnings:

(gnome-latex:26858): Gtk-WARNING **: 14:41:48.496: Locale not supported by C library.
	Using the fallback 'C' locale.

(gnome-latex:26858): dconf-WARNING **: 14:41:48.524: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files

Any idea what that means?

@jtojnar
Copy link
Contributor

jtojnar commented Jun 21, 2018

The latter is caused by missing dconf service. You would need to add dconf to environment.systemPackages.

@manveru
Copy link
Contributor Author

manveru commented Jun 21, 2018

OK, thanks a lot for your help, your suggestions made this a whole lot cleaner (and apparently switching to the mirror got rid of the autotools dependency)

sha256 = "1z481izrx057wraphnr82kxnpmmi8nvl7jswyylzm22kfs0mw402";
};

passthru.updateScript = gnome3.updateScript { packageName = pname; };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this down before meta? We are trying to structure the expressions so that building instructions are first and meta things are last.

passthru.updateScript = gnome3.updateScript { packageName = pname; };

nativeBuildInputs = [
amtk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be in native inputs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't know the difference between buildInputs and nativeBuildInputs... i can try shuffling them around but it seems to build either way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference occurs during cross-compilation. nativeBuildInputs use the architecture of the builder (build platform), while buildInputs use the architecture of the host platform (the one the resulting program will be run). That means programs run during build (build managers, compilers, asset generators) need to go to nativeBuildInputs.

];

doCheck = false;
# TODO: seems like tests need a display:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe running those in xvfb would help:

xvfb-run -s '-screen 0 800x600x24' dbus-run-session \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to fail with this:

FAIL: test-file-metadata
========================

/file/get_set_metadata: OK
/file/load_save_metadata_sync:
(./test-file-metadata:20931): Tepl-WARNING **: 14:41:36.942: GVfs metadata is not supported. Fallback to TeplMetadataManager. Either GVfs is not correctly installed or GVfs metadata are not supported on this platform. In the latter case, you should configure Tepl with --disable-gvfs-metadata.
FAIL test-file-metadata (exit status: 133)

I'll try to find a solution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amtk tests work with this trick though, so that's also nice

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are building on tmpfs so some file attributes might not work. Probably nothing we can do about it.

homepage = https://wiki.gnome.org/Projects/Amtk;
description = "Actions, Menus and Toolbars Kit for GTK+ applications";
maintainers = [ maintainers.manveru ];
license = licenses.lgpl21;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be lgpl21Plus: https://gitlab.gnome.org/GNOME/amtk/blob/master/amtk/amtk-action-map.c#L8
The COPYING file usually contains only the text of the lower bound, since including the text of later versions is not possible.

@manveru
Copy link
Contributor Author

manveru commented Jun 21, 2018

I think that's about all I can fix... couldn't make 100% sure the buildInputs/nativeBuildInputs work because my cross-compilation failed for other reasons, but hopefully it's better now.


buildInputs = with gnome3; [
amtk
dconf.dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you specifically requesting dconf.dev? Actually, we should probably build with --disable-dconf-migration as we did not have the package before so there are no old GSettings paths to migrate.

];

buildInputs = [
dbus.daemon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would go to nativeBuildInputs, as dbus-run-session is run by the build platform. Also the binary is not part of dbus.daemon but dbus.


buildInputs = [
dbus.daemon
gnome3.gtk.dev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why specifically request dev output?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I found when looking for the missing file using nix-locate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we usually do not use dev outputs, since this will probably also use a library that will be in a different output (out). It works because the builder somehow inserts other outputs as well or something.

name = "${pname}-${version}";

src = fetchurl {
url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${pname}-${version}.tar.xz";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about misinformation, we now have stdenv.lib.versions.majorMinor which should be preferred.

passthru.updateScript = gnome3.updateScript { packageName = pname; };

meta = with stdenv.lib; {
homepage = "https://wiki.gnome.org/Apps/GNOME-LaTeX";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove quotes here as well.

@manveru
Copy link
Contributor Author

manveru commented Jun 22, 2018

One more update ;)

@jtojnar jtojnar merged commit 0463c20 into NixOS:master Jun 25, 2018
@manveru manveru deleted the add-gnome-latex branch July 6, 2018 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants