Windows pkg_config failed: `"pkg-config" "--libs" "--cflags" "dbus-1" "dbus-1 >= 1.6"` did not exit successfully - windows

I'm attempting to compile a Rust app on windows, and I've hit a problem I don't know how to solve. Running cargo build produces:
--- stderr
pkg_config failed: `"pkg-config" "--libs" "--cflags" "dbus-1" "dbus-1 >= 1.6"` did not exit successfully: exit code: 1
--- stderr
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
One possible solution is to check whether packages
'libdbus-1-dev' and 'pkg-config' are installed:
On Ubuntu:
sudo apt install libdbus-1-dev pkg-config
On Fedora:
sudo dnf install dbus-devel pkgconf-pkg-config
Can this advice (to install libdbus-1-dev) be adjusted for Windows? What is the general process for such, in case I hit a similar problem on another package after resolving this one?

Related

Cannot build open-source project

I'd like to contribute to an OSS project built with go, but I'm having hard time compiling it. It looks as if I'm missing something obvious.
I think the problem is related to how go is installed on my computer, and not to the project itself, thus I'm posting it here on StackOverflow, instead of project's "Issues" section.
Below is what I'm doing.
I've installed go using homebrew:
$ brew install go
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
libebml
==> Downloading https://homebrew.bintray.com/bottles/go-1.8.3.sierra.bottle.tar.gz
Already downloaded: /Users/gmile/Library/Caches/Homebrew/go-1.8.3.sierra.bottle.tar.gz
==> Pouring go-1.8.3.sierra.bottle.tar.gz
==> Caveats
A valid GOPATH is required to use the `go get` command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATH
You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
🍺 /usr/local/Cellar/go/1.8.3: 7,035 files, 282.0MB
$
Then I cloned the repo:
$ hub clone lucapette/fakedata
I ran make setup (per instruction), which at first did not complete successfully:
$ make setup
go get -u github.com/alecthomas/gometalinter
gometalinter --install
make: gometalinter: No such file or directory
make: *** [setup] Error 1
$
I figured that is because gometalinter is nowhere in my $PATH, so have added it (I'm using fish-shell):
$ set fish_user_paths /Users/gmile/go/bin
running make setup seem to have succeeded now. This is the output:
$ make setup
go get -u github.com/alecthomas/gometalinter
gometalinter --install
Installing:
aligncheck
deadcode
dupl
errcheck
gas
goconst
gocyclo
goimports
golint
gosimple
gotype
ineffassign
interfacer
lll
megacheck
misspell
safesql
staticcheck
structcheck
unconvert
unparam
unused
varcheck
$
Running make build fails:
$ make build
go build
main.go:11:2: cannot find package"github.com/lucapette/fakedata/pkg/fakedata" in any of:
/usr/local/Cellar/go/1.8.3/libexec/src/github.com/lucapette/fakedata/pkg/fakedata (from $GOROOT)
/Users/gmile/go/src/github.com/lucapette/fakedata/pkg/fakedata (from $GOPATH)
main.go:12:2: cannot find package "github.com/spf13/pflag" in any of:
/usr/local/Cellar/go/1.8.3/libexec/src/github.com/spf13/pflag (from $GOROOT)
/Users/gmile/go/src/github.com/spf13/pflag (from $GOPATH)
make: *** [build] Error 1
$
So either Contributing guideline is incomplete, or I'm missing something obvious about installing and managing go packages.
Your path when cloning the source must be on the golang PATH like :
/home/gujarat/golang/src/github.com/lucapette/fakedata
as you can see my Path to golang path is : /home/gujarat/golang/.
You can also print your golang path in your terminal by entering : $GOPATH.
And the git clone should be in the following the exact as above path : src/github.com/lucapette/.
cd $GOPATH/src/github.com/
mkdir lucaptte
cd lucapette
git clone https://github.com/lucapette/fakedata.git
When you are running the make command which trigger go build this command will look the $GOPATH and your $GOROOT folder.
Your go source should in your gopath - here it is Users/gmile/src. Use go get to fetch the pkg you want to work on instead and it should work.

Why is /var/lib/dpkg/status missing on a BitBake-generated OS?

I have installed apt onto a system built by BitBake by adding the apt package to the IMAGE_INSTALL variable in my recipe.
apt-get and apt-cache now execute on the built system, but if I try to do anything useful with them (such as apt-get update or apt-cache search), I get the following error:
E: Could not open file /var/lib/dpkg/status - open (2: No such file or directory)
E: The package lists or status file could not be parsed or opened
After some preliminary searching, I found this exchange on the Yocto Project mailing list:
Hi,
I have some requirement with apt-get in yocto genearted rootfs.
I built the yocto source code with enabling the apt package.
But after booting the image on my machine and run the "apt-get" command for installing some package it gives the following error.
Could not open the file /var/lib/dpkg/status open(2: no such a file or directory).
The package lists or status files could not be parsed or opened.
This error is because you need to add package-management to EXTRA_IMAGE_FEATURES in local.conf,
PACKAGE_CLASSES ?= "package_deb"
EXTRA_IMAGE_FEATURES = "debug-tweaks package-management"
I've added package-management but don't see any different output.
After a touch /var/lib/dpkg/status, apt-get update returns the following:
Reading package lists...Done
How can I get apt into a functioning state through the use of BitBake metadata?
I have found a similar thread from the NXP website.
You would need to set up your own web server and provide all those packages and add the server URL to the source list. SourceList
In addition, you have to update the package manifest by running bitbake package-index and add PACKAGE_CLASSES ?= " package_deb" to conf/local.conf
I have successfully set up OPKG before. The steps are similar, you can find it here

dpkg error: contains ununderstood data member

I'm trying to install a jailbreak tweak using make package install but I'm receiving this error from dpkg:
dpkg-deb: file `/tmp/_theos_install.deb' contains ununderstood data member data.tar.xz , giving up
dpkg: error processing /tmp/_theos_install.deb (--install):
subprocess dpkg-deb --fsys-tarfile returned error exit status 2
Errors were encountered while processing:
/tmp/_theos_install.deb
make: *** [internal-install] Error 1
So as far as I can tell it isn't able to understand the .xz extension, but I'm not sure why that file is being created. Thanks for the help.
I found out how to fix it. In $THEOS/makefiles/package/deb.mk replace this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
with this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -Zgzip -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
The .deb file is created because you told Theos build system to do that. The package install rule of the Makefile is creating the Debian package using xz compression. Now, this kind of compression is supported by versions of dpkg equal or higher than 1.15.6.
So, in order to solve your problem, you should update dpkg to a newer version or install Theos without packaging support. Probably a simple make install will do it.
In case that updating dpkg isn't possible and you don't want to install the program without package management support, the other (more painful) method is to change the algorithm in which the package is compressed. Here you have good information about how to do this.
In my case I was building a package on Ubuntu 18.04 and trying to install that package on Debian 7 (airgapped). I had to change the line in the Makefile that read:
dpkg --build $(DESTDIR)
..to:
dpkg-deb --build -Zgzip $(DESTDIR)
Thanks Connor!
Other option that you can try is to unpack the .deb that you where triying to install and repack with no XZ compression.
Unpack:
mkdir package/ && dpkg -x package.deb package/
Pack:
dpkg-deb --build -Zgzip package/
You can rename the resulting package with:
dpkg-name -o package.deb
Or simply name the package dir with the name of your package.
Important: In orther to perform this, you need to install dpkg-dev package:
sudo apt update
sudo apt install dpkg-dev

Install external package in Google Go

I was trying to install external packages in GO language. I've found many external packages at http://godashboard.appspot.com/package.
I am working on windows system.
I tried this command to install go-router package.
goinstall go-router.googlecode.com/svn/trunk
This resulted in following error....
C:\cygwin\bin\bash.exe: === cd c:\go\src\pkg\go-router.googlecode.com\svn\trunk;
bash gomake -f- install
/cygdrive/c/go/bin/gomake: line 3: exec: make: not found
--- exit status 127
goinstall: go-router.googlecode.com/svn/trunk: install: running bash: exit status 127
I am unable to find out the reason for the error and the meaning of status code. I've read the goinstall command description but no luck..
It seems make command is missing. Make sure it's installed and that PATH variable is defined correctly.

easy_install M2Crypto failing on Windows platform

I am attempting to install M2Crypto on a Windows XP platform. I have Python, easy_install and SWIG installed, but when I attempt to easy_install M2Crypto I get the following:
SWIG\_m2crypto.i(31) : Error: Unable to find 'openssl\opensslv.h'
SWIG\_m2crypto.i(45) : Error: Unable to find 'openssl\safestack.h'
SWIG\_evp.i(12) : Error: Unable to find 'openssl\opensslconf.h'
SWIG\_ec.i(7) : Error: Unable to find 'openssl\opensslconf.h'
error: Setup script exited with error: command 'swig.exe' failed with exit status 1
I have read elsewhere that people have suggested easy_install openssl-devel, but that simply tells me that there are no packages found with that name. Is the name perhaps case-sensitive (I've tried various permutations without success), or does that advice not apply to Windows?
I'm not looking for alternatives to M2Crypto. I am picking up some existing code that uses it, so I need to get my development environment to be able to run what's already written.
As jay stated in his answer you should try to build it from source. And I tried. The setup.py does not recognize the --openssl option. Looking at the output from the default setup.py I realized that the search location was c:\pkg and not c:\pkg\openssl.
The solution:
Download and install OpenSSL from Win32 OpenSSL
Copy the lib and include folders to c:\pkg
Check that swig.exe is available in your path
Run easy_install M2Crypto
Worked for me like a charm.
Had a similar problem. After downloading the source package of M2Crypto and reading the INSTALL file I found the following:
Differences when installing on Windows
--------------------------------------
Before building from source, you need to install OpenSSL's include files,
import libraries and DLLs. By default setup.py assumes that OpenSSL include
files are in ``c:\pkg\openssl\include``, and the import libraries
in ``c:\pkg\openssl\lib``. As with other platforms, you can specify a different
OpenSSL location with --openssl option to build_ext command.

Resources