sergei-mironov / xkb-switch

Switch your X keyboard layouts from the command line
MIT License
345 stars 37 forks source link

Can't build the program on ubuntu 18.04 #42

Closed Rom888 closed 4 years ago

Rom888 commented 4 years ago

I tried to build the program on ubuntu 18.04 using this instruction https://github.com/ierton/xkb-switch#installing

sudo apt update
cd ~/Downloads
mkdir xkb-switch
tar -xvzf xkb-switch-1.6.0.tar.gz -C xkb-switch 
cd xkb-switch/xkb-switch-1.6.0
mkdir build && cd build
sudo apt install cmake
cmake ..

but got the following error:

CMake Error at /usr/share/cmake-3.10/Modules/FindX11.cmake:429 (message):
  Could not find X11
Call Stack (most recent call first):
  CMakeLists.txt:11 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/home/rom/Downloads/xkb-switch/xkb-switch-1.6.0/build/CMakeFiles/CMakeOutput.log".

Could you help me, please?

sergei-mironov commented 4 years ago

Hi, It probably means that you don't have X11 libraries on your system. Try follow the https://askubuntu.com/questions/526848/cmake-cant-find-x11 answers, install X11 headers

Rom888 commented 4 years ago

Thanks for the answer, I am not experienced with cmake. I executed: sudo apt-get install libx11-dev but got the following error:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libx11-dev : Depends: libx11-6 (= 2:1.6.4-3ubuntu0.1) but 2:1.6.4-3ubuntu0.2 is to be installed
              Depends: libxcb1-dev but it is not going to be installed
              Recommends: libx11-doc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Is there a way to get the updated package with all required dependencies or more detailed instruction how to build this program?

zvezdochiot commented 4 years ago

@Rom888 say> Is there a way...?

Instruction: 1) Tidy up your system 2) ...

sergei-mironov commented 4 years ago

Thanks for the answer, I am not experienced with cmake. I executed: sudo apt-get install libx11-dev but got the following error:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libx11-dev : Depends: libx11-6 (= 2:1.6.4-3ubuntu0.1) but 2:1.6.4-3ubuntu0.2 is to be installed
              Depends: libxcb1-dev but it is not going to be installed
              Recommends: libx11-doc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Is there a way to get the updated package with all required dependencies or more detailed instruction how to build this program?

Sorry, this question should probably go to Ubuntu support forums, since it doesn't related to xkb-switch directly. Personally, I don't use Ubuntu exactly because of it's dependency hell. If you feel brave and have some time, you may try Nix package manager. I provide the build expression for it in this repo. Nix offers good hell-protection by design. But this way is definitely not for beginners.