Package Details: rusty-keys-git 0.0.2.r18.g0ffc169-1

Git Clone URL: https://aur.archlinux.org/rusty-keys-git.git (read-only, click to copy)
Package Base: rusty-keys-git
Description: uinput level keyboard mapper for linux
Upstream URL: https://code.moparisthebest.com/moparisthebest/rusty-keys
Licenses: AGPL
Conflicts: rusty-keys
Provides: rusty-keys
Submitter: moparisthebest
Maintainer: moparisthebest
Last Packager: moparisthebest
Votes: 0
Popularity: 0.000000
First Submitted: 2017-11-16 05:54 (UTC)
Last Updated: 2019-01-10 05:30 (UTC)

Required by (0)

Sources (1)

Latest Comments

dreieck commented on 2023-07-13 16:53 (UTC)

Thanks for the change!

Can you also add export CARGO_HOME="${srcdir}/.cargo" to prepare() and build() so that rust does not clutter the home dir?

And actually, $pkgver now begins with beta, which is a version decrease. So you either need to increment $epoch or change the pkgver() logic.

Official version is 0.0.3, as rusty-keys --version reveals. That needs to be parsed from the source, if git tags are unreliable.
grep -E '^[[:space:]]*version[[:space:]]*=' Cargo.toml | awk -F= '{print $2}' | tr -d \"\'' ' does it for me.

pkgver() could look like:

pkgver() {
  cd "${srcdir}/rusty-keys"

  _ver="$(grep -E '^[[:space:]]*version[[:space:]]*=' Cargo.toml | awk -F= '{print $2}' | tr -d \"\'' ')"
  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_ver}" ]; then
    error "Version could not be determined."
    return 1
  else
    printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
  fi
}

(See also my package rusty-keys-nosystemd-git.)

Regards!

moparisthebest commented on 2019-01-10 05:32 (UTC)

The compilation errors were due to upstream not providing Cargo.lock, this has been fixed.

I also put cargo fetch in prepare() so build() no longer downloads anything, thanks for the pointer.

dreieck commented on 2018-12-15 17:35 (UTC)

Fails to build:

==> Starting build()...
[...]
   Compiling rusty-keys v0.0.2 (/tmp/yaourt-tmp-felics/aur-rusty-keys-git/src/rusty-keys-git)                                                                                                                                                                             
error[E0308]: mismatched types                                                                                                                                                                                                                                            
  --> src/device/builder.rs:97:26                                                                                                                                                                                                                                         
   |                                                                                                                                                                                                                                                                      
97 |             ui_set_evbit(self.fd, EV_KEY as *const c_int)?;                                                                                                                                                                                                          
   |                                   ^^^^^^^^^^^^^^^^^^^^^^ expected i32, found *-ptr                                                                                                                                                                                   
   |                                                                                                                                                                                                                                                                      
   = note: expected type `i32`                                                                                                                                                                                                                                            
              found type `*const i32`                                                                                                                                                                                                                                     

error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`                                                                                                                                                                               
  --> src/device/builder.rs:97:4                                                                                                                                                                                                                                          
   |                                                                                                                                                                                                                                                                      
97 |             ui_set_evbit(self.fd, EV_KEY as *const c_int)?;                                                                                                                                                                                                          
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `i32`                                                                                                                                                          
   |                                                                                                                                                                                                                                                                      
   = help: the trait `std::ops::Try` is not implemented for `i32`                                                                                                                                                                                                         
   = note: required by `std::ops::Try::into_result`                                                                                                                                                                                                                       

error[E0308]: mismatched types                                                                                                                                                                                                                                            
   --> src/device/builder.rs:100:28                                                                                                                                                                                                                                       
    |                                                                                                                                                                                                                                                                     
100 |                 ui_set_keybit(self.fd, *key_code as *const c_int)?;                                                                                                                                                                                                 
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found *-ptr                                                                                                                                                                          
    |                                                                                                                                                                                                                                                                     
    = note: expected type `i32`                                                                                                                                                                                                                                           
               found type `*const i32`                                                                                                                                                                                                                                    

error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`                                                                                                                                                                               
   --> src/device/builder.rs:100:5                                                                                                                                                                                                                                        
    |                                                                                                                                                                                                                                                                     
100 |                 ui_set_keybit(self.fd, *key_code as *const c_int)?;                                                                                                                                                                                                 
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `i32`                                                                                                                                                 
    |                                                                                                                                                                                                                                                                     
    = help: the trait `std::ops::Try` is not implemented for `i32`                                                                                                                                                                                                        
    = note: required by `std::ops::Try::into_result`                                                                                                                                                                                                                      

error[E0308]: mismatched types                                                                                                                                                                                                                                            
   --> src/device/builder.rs:282:4                                                                                                                                                                                                                                        
    |                                                                                                                                                                                                                                                                     
282 |             try!(ui_dev_create(self.fd));                                                                                                                                                                                                                           
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found enum `std::result::Result`                                                                                                                                                                            
    |                                                                                                                                                                                                                                                                     
    = note: expected type `i32`                                                                                                                                                                                                                                           
               found type `std::result::Result<_, _>`                                                                                                                                                                                                                     
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)                                                                                                                         

error[E0308]: mismatched types                                                                                                                                                                                                                                            
   --> src/device/builder.rs:282:4                                                                                                                                                                                                                                        
    |                                                                                                                                                                                                                                                                     
282 |             try!(ui_dev_create(self.fd));                                                                                                                                                                                                                           
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found enum `std::result::Result`                                                                                                                                                                            
    |                                                                                                                                                                                                                                                                     
    = note: expected type `i32`                                                                                                                                                                                                                                           
               found type `std::result::Result<_, _>`                                                                                                                                                                                                                     
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)                                                                                                                         

error[E0599]: no method named `unwrap` found for type `i32` in the current scope                                                                                                                                                                                          
  --> src/device/device.rs:83:28                                                                                                                                                                                                                                          
   |                                                                                                                                                                                                                                                                      
83 |             ui_dev_destroy(self.fd).unwrap();                                                                                                                                                                                                                        
   |                                     ^^^^^^                                                                                                                                                                                                                           

error: aborting due to 7 previous errors                                                                                                                                                                                                                                  

Some errors occurred: E0277, E0308, E0599.                                                                                                                                                                                                                                
For more information about an error, try `rustc --explain E0277`.                                                                                                                                                                                                         
error: Could not compile `rusty-keys`.                                                                                                                                                                                                                                    

To learn more, run the command again with --verbose.
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build rusty-keys-git.

dreieck commented on 2018-12-15 16:03 (UTC)

It downloads stuff during build(). However, wghen executing build(), the presence of an internet connection should not be assumed.

Please download stuff via the source-array or, if not possible, in the prepare()-function.