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

Haiku paths support #11310

Merged
merged 2 commits into from Jan 20, 2023
Merged

Haiku paths support #11310

merged 2 commits into from Jan 20, 2023

Conversation

X547
Copy link
Contributor

@X547 X547 commented Jan 19, 2023

This patch set correct install path used by Haiku operating system (https://www.haiku-os.org/). Currently Haiku use after install Bash scripts to adjust install locations to Haiku native ones, but it is a hack and native Meson support would be preferred.

Background:

Haiku (and its descendent BeOS) use its own file system hierarchy that significantly differs from other UNIX-like systems. There are four install prefixes recognized by system:

  1. $HOME/config/non-packaged
  2. $HOME/config
  3. /boot/system/non-packaged
  4. /boot/non-packaged

/boot is a mount point of a volume containing currently booted system installation (something like C: in Windows, not boot loader data as in Linux). non-packaged directories means software not managed by package manager and installed manually (such as ninja install).

All development-related files such as pkg-config *.pc files, C/C++ headers, static libraries, symbolic links to dynamic libraries, compilers etc. should be installed to $prefix/develop directory.

Summary:

Command Haiku path
prefix /boot/system/non-packaged
bindir bin
datadir data
includedir develop/headers
infodir documentation/info
libdir lib (runtime), develop/lib (static libraries, symlinks for compiler use)
libexecdir lib
localedir data/locale
mandir documentation/man
sbindir bin
sysconfdir settings
pkgconfig develop/lib/pkgconfig, data/pkgconfig

Example install layout:

> tree install
install
├── develop
│   ├── headers
│   │   ├── EGL
│   │   │   ├── egl.h
│   │   │   ├── eglext.h
│   │   │   └── eglplatform.h
│   │   ├── GL
│   │   │   ├── gl.h
│   │   │   ├── glcorearb.h
│   │   │   └── glext.h
│   │   ├── GLES
│   │   │   ├── egl.h
│   │   │   ├── gl.h
│   │   │   ├── glext.h
│   │   │   └── glplatform.h
│   │   ├── GLES2
│   │   │   ├── gl2.h
│   │   │   ├── gl2ext.h
│   │   │   └── gl2platform.h
│   │   ├── GLES3
│   │   │   ├── gl3.h
│   │   │   ├── gl31.h
│   │   │   ├── gl32.h
│   │   │   ├── gl3ext.h
│   │   │   └── gl3platform.h
│   │   ├── glvnd
│   │   │   ├── GLdispatchABI.h
│   │   │   ├── libeglabi.h
│   │   │   └── libglxabi.h
│   │   ├── KHR
│   │   │   └── khrplatform.h
│   │   └── opengl
│   │       ├── GLRenderer.h
│   │       ├── GLView.h
│   │       └── OpenGLKit.h
│   └── lib
│       ├── libEGL.so -> ../../lib/libEGL.so.1
│       ├── libGL.so -> ../../lib/libGL.so.1
│       ├── libGLdispatch.so -> ../../lib/libGLdispatch.so.0
│       ├── libGLESv1_CM.so -> ../../lib/libGLESv1_CM.so.1
│       ├── libGLESv2.so -> ../../lib/libGLESv2.so.2
│       ├── libOpenGL.so -> ../../lib/libOpenGL.so.0
│       └── pkgconfig
│           ├── egl.pc
│           ├── gl.pc
│           ├── glesv1_cm.pc
│           ├── glesv2.pc
│           ├── libglvnd.pc
│           └── opengl.pc
└── lib
    ├── libEGL.so.1 -> libEGL.so.1.1.0
    ├── libEGL.so.1.1.0
    ├── libGL.so.1 -> libGL.so.1.0.0
    ├── libGL.so.1.0.0
    ├── libGLdispatch.so.0 -> libGLdispatch.so.0.0.0
    ├── libGLdispatch.so.0.0.0
    ├── libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.2.0
    ├── libGLESv1_CM.so.1.2.0
    ├── libGLESv2.so.2 -> libGLESv2.so.2.1.0
    ├── libGLESv2.so.2.1.0
    ├── libOpenGL.so.0 -> libOpenGL.so.0.0.0
    └── libOpenGL.so.0.0.0

Patch do not correctly handle symlinks to dynamic libraries used by compiler yet.

Copy link
Contributor

@tristan957 tristan957 left a comment

Choose a reason for hiding this comment

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

Everything looks alright to me other than my 2 comments, 1 of which might not actually be actionable.

mesonbuild/utils/universal.py Outdated Show resolved Hide resolved
mesonbuild/modules/pkgconfig.py Outdated Show resolved Hide resolved
@tristan957
Copy link
Contributor

Appreciate your upstreaming :)

@tristan957
Copy link
Contributor

Should you also change default_libdir()?

@X547
Copy link
Contributor Author

X547 commented Jan 19, 2023

Should you also change default_libdir()?

Default value lib is fine for Haiku runtime lib directory. Static libraries and compiler symlinks to shared libraries should be installed to develop/lib, but it can't be achieved with setting default_libdir() value and need some deeper changes (I would be appreciated to hear advices how to implement it).

mesonbuild/utils/universal.py Outdated Show resolved Hide resolved
mesonbuild/utils/universal.py Outdated Show resolved Hide resolved
@tristan957
Copy link
Contributor

tristan957 commented Jan 19, 2023

It would also be nice if you updated the docs to mention Haiku support. Perhaps we need a more expressive way to do https://mesonbuild.com/Builtin-options.html#directories if anyone has any ideas. Maybe the same table, but add columns for Default | Windows | Haiku with a comment about default being overridden on certain platforms. Just a thought.

Release notes snippet would be good to.

@eli-schwartz
Copy link
Member

Can you rebase this?

@X547 X547 requested review from eli-schwartz and removed request for xclaesse and jpakkane January 20, 2023 11:35
@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Merging #11310 (66b5955) into master (dd83d5e) will decrease coverage by 0.53%.
The diff coverage is 76.92%.

@@            Coverage Diff             @@
##           master   #11310      +/-   ##
==========================================
- Coverage   68.87%   68.35%   -0.53%     
==========================================
  Files         414      414              
  Lines       90234    90284      +50     
  Branches    20694    20709      +15     
==========================================
- Hits        62153    61711     -442     
- Misses      23409    23960     +551     
+ Partials     4672     4613      -59     
Impacted Files Coverage Δ
mesonbuild/modules/pkgconfig.py 85.90% <0.00%> (-0.58%) ⬇️
mesonbuild/utils/universal.py 78.34% <48.57%> (-0.83%) ⬇️
mesonbuild/coredata.py 84.00% <100.00%> (-0.04%) ⬇️
mesonbuild/interpreterbase/decorators.py 91.10% <100.00%> (+0.02%) ⬆️
mesonbuild/optinterpreter.py 77.94% <100.00%> (+3.79%) ⬆️
modules/cuda.py 0.00% <0.00%> (-72.65%) ⬇️
templates/cudatemplates.py 37.50% <0.00%> (-62.50%) ⬇️
compilers/cuda.py 19.63% <0.00%> (-45.40%) ⬇️
dependencies/cuda.py 20.19% <0.00%> (-42.79%) ⬇️
compilers/detect.py 43.79% <0.00%> (-3.05%) ⬇️
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@eli-schwartz eli-schwartz merged commit b1384b9 into mesonbuild:master Jan 20, 2023
@X547 X547 deleted the haiku-paths branch January 21, 2023 10:01
@nirbheek nirbheek added this to the 1.0.1 milestone Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants