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

thinkpad-scripts: init at 4.12.0 #81007

Merged
merged 1 commit into from Mar 31, 2020
Merged

thinkpad-scripts: init at 4.12.0 #81007

merged 1 commit into from Mar 31, 2020

Conversation

dawidsowa
Copy link
Contributor

Motivation for this change

Add thinkpad-scripts

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.


meta = {
description =
"Screen rotation, docking and other scripts for ThinkPad® X220 and X230 Tablet";
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't split lines please, it's harder to git grep that way..


makeFlags = [
"DESTDIR=$(out)"
"SPHINXBUILD=${python3Packages.sphinx}/bin/sphinx-build"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the output has to include documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to me that yes, unless I patch the Makefile

common-install:
    install -d "$(DESTDIR)/lib/udev/rules.d/"
    install -m 644 81-thinkpad-dock.rules -t "$(DESTDIR)/lib/udev/rules.d/"
#
    install -d "$(DESTDIR)/lib/udev/hwdb.d/"
    install -m 644 90-X2x0T-keyboard.hwdb -t "$(DESTDIR)/lib/udev/hwdb.d/"
#
    install -d "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-mutemic-acpi-hook -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-rotate-acpi-hook-1-normal -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-rotate-acpi-hook-1-rotated -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-rotate-acpi-hook-2-normal -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-rotate-acpi-hook-2-rotated -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-dock-acpi-hook-1-on -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-dock-acpi-hook-1-off -t "$(DESTDIR)/etc/acpi/events/"
    install -m 644 thinkpad-dock-acpi-hook-2 -t "$(DESTDIR)/etc/acpi/events/"
#
    cd desktop && $(MAKE) install
    cd doc && $(MAKE) install
#

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't have to (though I would have suggested a patch upstream) - you can use split output, see https://nixos.org/nixpkgs/manual/#sec-multiple-outputs- .

Copy link
Contributor

Choose a reason for hiding this comment

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

Or, if you don't mind, you can rm -r it in postInstall.

"SHELL=${bash}/bin/bash"
];

buildInputs = with python3Packages; [ sphinx ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
buildInputs = with python3Packages; [ sphinx ];
nativeBuildInputs = with python3Packages; [ sphinx ];

@dawidsowa
Copy link
Contributor Author

I feel stupid, but I've just realized that nix-build haven't actually used Makefile.
So, documentation isn't build.

@doronbehar
Copy link
Contributor

To be more precise: buildPythonPackage's builder doesn't use Makefile.

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

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

Perfect, thanks @dawidsowa and @doronbehar!

@timokau timokau merged commit aaa8a8b into NixOS:master Mar 31, 2020
@dawidsowa dawidsowa deleted the thinkpad branch March 31, 2020 23:03
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