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

Installing files in a pacman fakeroot environment fails without access to '/usr/local' #17

Closed
kyleguarco opened this issue Jun 26, 2019 · 14 comments

Comments

@kyleguarco
Copy link
Contributor

The package in the AUR fails to build because the Makefile tries to install it in the real filesystem root. When building pacman packages, a fakeroot is created so the files owned by the package can be placed in the filesystem properly.

I pushed a patch upstream to the AUR so the package builds properly. Here's the patch currently in upstream:

diff --git a/Makefile b/Makefile
index 6e25cbf..cc4f066 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,8 @@ all:
 
 install:
 	mkdir -p "$(DESTDIR)$(PREFIX)/bin"
-	install $(__NAME__) "/usr/local/bin/$(__NAME__)"
-	install $(__NAME_C__) "/usr/local/bin/$(__NAME_C__)"
+	install $(__NAME__) "$(DESTDIR)/usr/local/bin/$(__NAME__)"
+	install $(__NAME_C__) "$(DESTDIR)/usr/local/bin/$(__NAME_C__)"
 	cd ./man; $(MAKE) install
 
 clean:
@JLErvin
Copy link
Owner

JLErvin commented Jun 26, 2019

This looks good to me and successfully builds locally. Go ahead and open a pull request and I can merge.

@kyleguarco
Copy link
Contributor Author

That's why I opened the issue. I know it breaks the workflow, but I prefer not doing pull requests if I don't have to.

@JLErvin
Copy link
Owner

JLErvin commented Jun 26, 2019

Ok. I'll make the changes. Thanks for doing this.

@JLErvin JLErvin closed this as completed Jun 26, 2019
@kyleguarco
Copy link
Contributor Author

I noticed that you reverted the change. Was there some sort of issue?

@JLErvin
Copy link
Owner

JLErvin commented Jun 28, 2019

Ah yes I was going to ping you about this soon. The package builds with the patch so long as I don't change the Makefile. Making the changes here cause the build to fail, however.

@JLErvin JLErvin reopened this Jun 28, 2019
@kyleguarco
Copy link
Contributor Author

I'll keep the patch upstream in the AUR for now. This'll be on my #TODO when the issue occurs again.

@jolupa
Copy link

jolupa commented Jul 7, 2019

Hi! Trying to make a package for crux but the problem is the same, I can't use the fakeroot to build the package and the patch is not working... Is possible to change the make file to use fakeroot?
Thanks!

@kyleguarco
Copy link
Contributor Author

kyleguarco commented Jul 8, 2019

Hi! Trying to make a package for crux but the problem is the same, I can't use the fakeroot to build the package and the patch is not working... Is possible to change the make file to use fakeroot?
Thanks

@jolupa The patch I have above worked for JLErvin for a little while, but had to go back to his previous version because there were build errors.

The patch above suggests using an environment variable during build, in which you set the fakeroot to the current folder. In your PKGBUILD's build() function, prefix the call to make (or whatever) with DESTDIR="$pkgdir" and make sure it's present in the Makefile like above.

@jolupa
Copy link

jolupa commented Jul 8, 2019

@FlashDaggerX Oh! thank you that worked!
But I think that needs to be some easy way of doing the install in a fakeroot for packages building.
Thanks.

@JLErvin
Copy link
Owner

JLErvin commented Jul 8, 2019

@jolupa if the included makefile were like the one that @FlashDaggerX included above, does the build work?

@jolupa
Copy link

jolupa commented Jul 8, 2019

@JLErvin Yeah! it worked perfectly... In a few minutes I will try it to see if it works!
Thanks.

@JLErvin
Copy link
Owner

JLErvin commented Jul 9, 2019

Ok I'll push a commit that changes the default Makefile to the one above. I believe that the patch breaks if we use the new makefile instead of the old one. Once I push, can you remove the patch? @FlashDaggerX

@kyleguarco
Copy link
Contributor Author

Will do. Something is bothering me though, because this wasn't happening a few weeks ago. I can't find any significant changes to your makefile, so something must've changed on Arch's side.

@kyleguarco
Copy link
Contributor Author

Not relevant in current master (83dfb3d), will open once it occurs again.

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

No branches or pull requests

3 participants