Thanks Stefan!
Actually, these two approaches are slightly different I guess:
- the installation script you are linking manages the
installation and the subsequent steps, but doesn't manage the dependencies: for instance on my machine, it didn't find root and so manalyzer
is built without root support.
Maybe this is just something to adapt?
Brew on the other hand manages root and so knows how to link these two
together.
- The nice thing I like about brew is that one can "ship bottles" aka compiled version of the code; it is great and fast for
deployment and avoid compilation issues.
- I like that your setup does deploy and launch all the necessary executables ! I know brew can do
this too via brew services (see an example here: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/r/rabbitmq.rb#L83 ), maybe worth
investigating...?
- Brew relies on code tagging to better manage the bottles, so that it uses the tag to get a well-defined version of the
code and give a name to the version.
I had to implement my own tags e.g. midas-mod-2025-12-a to get a release.
I am not sure how to do in the
case of midas where the tags are not that frequent...
Thank you for the feedback, I will make the modifications (aka naming my formula
``midas-mod'') so that it doesn't collide with a future official midas one.
Concerning the MidasConfig.cmake issue, this is what I need
(note that the INTERFACE_INCLUDE_DIRECTORIES is pointing to
/opt/homebrew/Cellar/midas/midas-mod-2025-12-a/)
set_target_properties(midas::midas PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "HAVE_CURL;HAVE_MYSQL;HAVE_SQLITE;HAVE_FTPLIB"
INTERFACE_COMPILE_OPTIONS "-I/opt/homebrew/Cellar/mariadb/12.1.2/include/mysql;-I/opt/homebrew/Cellar/mariadb/12.1.2/include/mysql/mysql"
INTERFACE_INCLUDE_DIRECTORIES "/opt/homebrew/Cellar/midas/midas-mod-2025-12-a/;${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "/opt/
homebrew/opt/zlib/lib/libz.dylib;-lcurl;-L/opt/homebrew/Cellar/mariadb/12.1.2/lib/ -lmariadb;/opt/homebrew/opt/sqlite/lib/libsqlite3.dylib"
)
whereas by default INTERFACE_INCLUDE_DIRECTORIES points to the source code location (in the case of brew, something like /private/<some-
hash> ).
Brew deletes the source code at the end of the installation, whereas midas seems to rely on the fact that the source code is still
present...
Does it help?
A way to fix is to search for this ``/private'' path and replace it, but this isn't ideal I guess...
This is what I
did in the midas formula:
--------
# Fix broken CMake export paths if they exist
cmake_files = Dir["#{lib}/**/*manalyzer*.cmake"]
cmake_files.each do |file|
if File.read(file).match?(%r{/private/tmp/midas-[^/"]+})
inreplace file, %r{/private/tmp/midas-
[^/"]+},
prefix.to_s
end
inreplace file, %r{/tmp/midas-[^/"]+}, prefix.to_s if File.read(file).match?(%r{/tmp/midas-[^/"]+})
end
cmake_files = Dir["#{lib}/**/*midas*.cmake"]
cmake_files.each do |file|
if File.read(file).match?(%r{/private/tmp/midas-
[^/"]+})
inreplace file, %r{/private/tmp/midas-[^/"]+},
prefix.to_s
end
inreplace file, %r{/tmp/midas-[^/"]+},
prefix.to_s if File.read(file).match?(%r{/tmp/midas-[^/"]+})
end
-----
I guess this code could be changed into some bash commands and
added to your script?
Thank you very much again!
Mathieu
> Hi Mathieu,
>
> thanks for your contribution. Have you looked at the
install.sh script I developed last week:
>
> https://daq00.triumf.ca/MidasWiki/index.php/Install_Script
>
> which basically does the
same, plus it modifies the environment and installs mhttpd as a service.
>
> Actually I modeled the installation after the way Homebrew is
installed in the first place (using curl).
>
> I wonder if the two things can kind of be integrated. Would be great to get with brew always
the newest midas version, and it would also
> check and modify the environment.
>
> If you tell me exactly what is wrong
MidasConfig.cmake.in I'm happy to fix it.
>
> Best,
> Stefan |