Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a brew formula if the installation require sudo?

I would like to write a brew formula but it looks like my library, which registers in Mono's GAC, would require sudo rights. which goes against brew idea of not sudoing.

Is there a work around ?

gacutil -i /private/tmp/fsharp-qdRr/fsharp-3.0.24/lib/release/4.0/FSharp.Core.dll -root /Library/Frameworks/Mono.framework/Versions/3.0.1/lib/ -package 4.0
gacutil -i /private/tmp/fsharp-qdRr/fsharp-3.0.24/lib/release/2.1/FSharp.Core.dll -root /Library/Frameworks/Mono.framework/Versions/3.0.1/lib/ -package 2.1
gacutil -i /private/tmp/fsharp-qdRr/fsharp-3.0.24/lib/release/2.0/FSharp.Core.dll -root /Library/Frameworks/Mono.framework/Versions/3.0.1/lib/ -package 2.0
Failure adding assembly /private/tmp/fsharp-qdRr/fsharp-3.0.24/lib/release/2.0/FSharp.Core.dll to the cache: gac directories could not be created, possibly permission issues.
Failure adding assembly /private/tmp/fsharp-qdRr/fsharp-3.0.24/lib/release/4.0/FSharp.Core.dll to the cache: gac directories could not be created, possibly permission issues.
Failure adding assembly /private/tmp/fsharp-qdRr/fsharp-3.0.24/lib/release/2.1/FSharp.Core.dll to the cache: gac directories could not be created, possibly permission issues.make[2]: *** [install-lib-4] Error 1

and the dir mentioned as installation point is owned by the root user

➜   pwd
/Library/Frameworks/Mono.framework/Versions/3.0.1/lib
➜   ls -ld .
drwxr-xr-x  324 root  admin  11016 Dec  1 17:41 .
like image 888
nicolas Avatar asked Dec 19 '25 18:12

nicolas


1 Answers

Mono allows you to have multiple GAC folders -- this way you can keep a per-user GAC (in some folder that you have write/execute privileges) and a system-wide GAC. Whenever an assembly is loaded from the GAC, it'll search the user's GAC first, then fall back to the system-wide GAC if necessary.

like image 159
Jack P. Avatar answered Dec 23 '25 06:12

Jack P.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!