Skip to content
This repository was archived by the owner on Nov 27, 2017. It is now read-only.

Create xorg_requirement.rb #1039

Closed
wants to merge 2 commits into from
Closed

Create xorg_requirement.rb #1039

wants to merge 2 commits into from

Conversation

rwhogg
Copy link
Contributor

@rwhogg rwhogg commented Apr 4, 2016

This creates a new XorgRequirement class and hacks X11Requirement to defer to it as necessary.
It also removes some hackery from xquartz.rb that just pretended X11 was already installed.

Closes #951

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable? Here's an example if you'd like one.
  • Have you successfully ran brew tests with your changes locally?

@rwhogg
Copy link
Contributor Author

rwhogg commented Apr 4, 2016

I cannot emphasize enough how much a work-in-progress this is. It works, but telling the various X11Requirement methods to defer to their XorgRequirement counterparts is just awful.

What I think might work better is having XorgRequirement extend X11Requirement and mapping depends_on :x11 to

Nevertheless, submitting the PR so there's a visible indication of my progress.

@@ -95,7 +94,6 @@ def provided_by_apple?
# remain public. New code should use MacOS::X11.bin, MacOS::X11.lib and
# MacOS::X11.include instead, as that accounts for Xcode-only systems.
def prefix
@prefix ||= Pathname.new("/usr") if OS.linux?
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've just removed this for now, but I think I need to do more than that.

Assuming we want to prefer the Linuxbrew/xorg/xorg installation over anything else, something like this might make more sense (pardon my mediocre Ruby-fu):

if OS.linux?
  @prefix ||= if Pathname.new(cellar/"xorg").exist?
    # Not sure if this case is really necessary... not all that familiar with this code ATM
    Pathname.new(ENV["HOMEBREW_PREFIX"])
  elsif Pathname.new("/usr/lib/x86_64-linux-gnu/libX11.so").exist?
    Pathname.new("/usr")
  end
end

Copy link
Contributor

Choose a reason for hiding this comment

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

On RHEL/Centos that libX11.so doesn't exist - it is in /usr/lib64/libX11.so

@sjackman
Copy link
Member

sjackman commented Apr 4, 2016

LinuxbrewTestBot error:

  1) Error:
X11RequirementTests#test_satisfied:
TapFormulaUnavailableError: No available formula with the name "linuxbrew/xorg/xorg" 
Please tap it and then try again: brew tap linuxbrew/xorg

I thought that this bug was fixed. =/
See #938 and Homebrew/legacy-homebrew#50271

@sjackman
Copy link
Member

sjackman commented Apr 4, 2016

What I think might work better is having XorgRequirement extend X11Requirement and mapping depends_on :x11 to XorgRequirement

👍

@sjackman
Copy link
Member

sjackman commented Apr 4, 2016

$ brew install gobject-introspection
==> Tapping homebrew/dupes
Cloning into '/home/sjackman/.linuxbrew/Library/Taps/homebrew/homebrew-dupes'...

It looks fixed to me. I wonder why this requirement doesn't tap. Perhaps because it's in brew tests which behaves differently than reality some times…
Does the auto-tapping work when you try it outside of brew tests?

Bob W. Hogg added 2 commits April 10, 2016 19:49
Closes #951

This provides a new XorgRequirement formula and hacks the X11Requirement
to use it instead.
@rwhogg rwhogg closed this May 2, 2016
@rwhogg rwhogg removed the in progress label May 2, 2016
@rwhogg rwhogg deleted the xorg-requirement branch May 2, 2016 21:47
@rwhogg
Copy link
Contributor Author

rwhogg commented May 2, 2016

Moved to Linuxbrew/brew#10

@Linuxbrew Linuxbrew locked and limited conversation to collaborators May 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants